xfs: fix superblock inprogress check
PATCH 1/1 xfs: fix superblock inprogress check
From: Dave Chinner <[email protected]>
Quoted 1 line
From inspection, the superblock
sb_inprogresscheck 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.
--- fs/xfs/libxfs/xfs_sb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/libxfs/xfs_sb.c +2 -1
@@ -583,7 +583,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); }
Signature · 6 lines
2.8.0.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Dave Chinner
From: Dave Chinner <[email protected]>
From inspection, the superblock
sb_inprogresscheck 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:
Quoted 6 lines
bp->b_bn = XFS_BUF_DADDR_NULL; /* always null for uncached buffers */And so this check never triggers. Fix it.
Signed-off-by Dave Chinner <[email protected]>---
Quoted 24 lines
fs/xfs/libxfs/xfs_sb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/xfs/libxfs/xfs_sb.c +2
-1@@ -583,7 +583,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); }Signature · 6 lines
2.8.0.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Quoted 1 line
From inspection, the superblock
sb_inprogresscheck is done in theverifier 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 */
Hmm, I wonder why we did that, it seems a bit counter intuitive.
But the patch itself looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs