public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call
@ 2013-08-27 21:15 Brian Foster
  2013-08-27 21:25 ` Eric Sandeen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Brian Foster @ 2013-08-27 21:15 UTC (permalink / raw)
  To: xfs

The call to xfs_inobt_get_rec() in xfs_dialloc_ag() passes 'j' as
the output status variable. The immediately following
XFS_WANT_CORRUPTED_GOTO() checks the value of 'i,' which is from
the previous lookup call and has already been checked. Fix the
corruption check to use 'j.'

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_ialloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 6bee95d..ccf2fb1 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -729,7 +729,7 @@ xfs_dialloc_ag(
 		error = xfs_inobt_get_rec(cur, &rec, &j);
 		if (error)
 			goto error0;
-		XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
+		XFS_WANT_CORRUPTED_GOTO(j == 1, error0);
 
 		if (rec.ir_freecount > 0) {
 			/*
-- 
1.8.1.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call
  2013-08-27 21:15 [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call Brian Foster
@ 2013-08-27 21:25 ` Eric Sandeen
  2013-08-27 22:47 ` Dave Chinner
  2013-08-30 18:49 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2013-08-27 21:25 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On 8/27/13 4:15 PM, Brian Foster wrote:
> The call to xfs_inobt_get_rec() in xfs_dialloc_ag() passes 'j' as
> the output status variable. The immediately following
> XFS_WANT_CORRUPTED_GOTO() checks the value of 'i,' which is from
> the previous lookup call and has already been checked. Fix the
> corruption check to use 'j.'
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

whoops!  That's been there a while, good catch.

It's harmless in the non-corruption case, but misses the corruption case...

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/xfs/xfs_ialloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
> index 6bee95d..ccf2fb1 100644
> --- a/fs/xfs/xfs_ialloc.c
> +++ b/fs/xfs/xfs_ialloc.c
> @@ -729,7 +729,7 @@ xfs_dialloc_ag(
>  		error = xfs_inobt_get_rec(cur, &rec, &j);
>  		if (error)
>  			goto error0;
> -		XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
> +		XFS_WANT_CORRUPTED_GOTO(j == 1, error0);
>  
>  		if (rec.ir_freecount > 0) {
>  			/*
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call
  2013-08-27 21:15 [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call Brian Foster
  2013-08-27 21:25 ` Eric Sandeen
@ 2013-08-27 22:47 ` Dave Chinner
  2013-08-30 18:49 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2013-08-27 22:47 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Tue, Aug 27, 2013 at 05:15:45PM -0400, Brian Foster wrote:
> The call to xfs_inobt_get_rec() in xfs_dialloc_ag() passes 'j' as
> the output status variable. The immediately following
> XFS_WANT_CORRUPTED_GOTO() checks the value of 'i,' which is from
> the previous lookup call and has already been checked. Fix the
> corruption check to use 'j.'
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call
  2013-08-27 21:15 [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call Brian Foster
  2013-08-27 21:25 ` Eric Sandeen
  2013-08-27 22:47 ` Dave Chinner
@ 2013-08-30 18:49 ` Ben Myers
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Myers @ 2013-08-30 18:49 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Tue, Aug 27, 2013 at 05:15:45PM -0400, Brian Foster wrote:
> The call to xfs_inobt_get_rec() in xfs_dialloc_ag() passes 'j' as
> the output status variable. The immediately following
> XFS_WANT_CORRUPTED_GOTO() checks the value of 'i,' which is from
> the previous lookup call and has already been checked. Fix the
> corruption check to use 'j.'
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-30 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 21:15 [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call Brian Foster
2013-08-27 21:25 ` Eric Sandeen
2013-08-27 22:47 ` Dave Chinner
2013-08-30 18:49 ` Ben Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox