diff options
author | Dave Chinner <dchinner@redhat.com> | 2016-08-26 16:01:30 +1000 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-09-12 13:26:47 -0400 |
commit | d023f70ec430bc8431012e04117eb20d9d334fd1 (patch) | |
tree | b90e80c25f3b8519d6fcb546196afb0980dcf363 | |
parent | 206538f128e7e3410e4042f7f15ccb1885adf477 (diff) | |
download | lwn-d023f70ec430bc8431012e04117eb20d9d334fd1.tar.gz lwn-d023f70ec430bc8431012e04117eb20d9d334fd1.zip |
xfs: fix superblock inprogress check
[ Upstream commit f3d7ebdeb2c297bd26272384e955033493ca291c ]
From inspection, the superblock sb_inprogress check is done in the
verifier and triggered only for the primary superblock via a
"bp->b_bn == XFS_SB_DADDR" check.
Unfortunately, the primary superblock is an uncached buffer, and
hence it is configured by xfs_buf_read_uncached() with:
bp->b_bn = XFS_BUF_DADDR_NULL; /* always null for uncached buffers */
And so this check never triggers. Fix it.
cc: <stable@vger.kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_sb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 535bd843f2f4..901f11b30174 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -539,7 +539,8 @@ xfs_sb_verify( * Only check the in progress field for the primary superblock as * mkfs.xfs doesn't clear it from secondary superblocks. */ - return xfs_mount_validate_sb(mp, &sb, bp->b_bn == XFS_SB_DADDR, + return xfs_mount_validate_sb(mp, &sb, + bp->b_maps[0].bm_bn == XFS_SB_DADDR, check_version); } |