xfs: check correct status variable for xfs_inobt_get_rec() call
PATCH 1/1 xfs: check correct status variable for xfs_inobt_get_rec() call
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.'
--- fs/xfs/xfs_ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_ialloc.c +1 -1
@@ -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 ) {/*
Signature · 6 lines
1.8.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Brian Foster
The call to
xfs_inobt_get_rec()inxfs_dialloc_ag()passes 'j' as the output status variable. The immediately followingXFS_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 <[email protected]>
whoops! That's been there a while, good catch.
It's harmless in the non-corruption case, but misses the corruption case...
Quoted 10 lines
--- fs/xfs/xfs_ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_ialloc.c +0
-0
fs/xfs/xfs_ialloc.c xfs_dialloc_ag( · line 735
Quoted 8 lines
fs/xfs/xfs_ialloc.c +1
-1@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Brian Foster
The call to
xfs_inobt_get_rec()inxfs_dialloc_ag()passes 'j' as the output status variable. The immediately followingXFS_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 <[email protected]>
Looks good.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Ben Myers
AppliedQuoted 7 lines · Brian Foster
The call to
xfs_inobt_get_rec()inxfs_dialloc_ag()passes 'j' as the output status variable. The immediately followingXFS_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 <[email protected]>
Applied.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs