| To: | Brian Foster <bfoster@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Tue, 27 Aug 2013 16:25:57 -0500 |
| Cc: | xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1377638145-18800-1-git-send-email-bfoster@xxxxxxxxxx> |
| References: | <1377638145-18800-1-git-send-email-bfoster@xxxxxxxxxx> |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
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@xxxxxxxxxx>
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@xxxxxxxxxx>
> ---
> 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) {
> /*
>
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call, Brian Foster |
|---|---|
| Next by Date: | [PATCH v2] xfs: don't leak root inode reference, Ben Myers |
| Previous by Thread: | [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call, Brian Foster |
| Next by Thread: | Re: [PATCH] xfs: check correct status variable for xfs_inobt_get_rec() call, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |