* [PATCH] xfs: fix superblock inprogress check
@ 2016-08-22 5:39 Dave Chinner
2016-08-24 18:07 ` Brian Foster
2016-08-25 8:08 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Dave Chinner @ 2016-08-22 5:39 UTC (permalink / raw)
To: linux-xfs; +Cc: xfs
From: Dave Chinner <dchinner@redhat.com>
>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.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/libxfs/xfs_sb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 0e3d4f5..4aecc5f 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -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);
}
--
2.8.0.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix superblock inprogress check
2016-08-22 5:39 [PATCH] xfs: fix superblock inprogress check Dave Chinner
@ 2016-08-24 18:07 ` Brian Foster
2016-08-25 8:08 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2016-08-24 18:07 UTC (permalink / raw)
To: Dave Chinner; +Cc: linux-xfs, xfs
On Mon, Aug 22, 2016 at 03:39:27PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> 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.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_sb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index 0e3d4f5..4aecc5f 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -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);
> }
>
> --
> 2.8.0.rc3
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix superblock inprogress check
2016-08-22 5:39 [PATCH] xfs: fix superblock inprogress check Dave Chinner
2016-08-24 18:07 ` Brian Foster
@ 2016-08-25 8:08 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2016-08-25 8:08 UTC (permalink / raw)
To: Dave Chinner; +Cc: linux-xfs, xfs
On Mon, Aug 22, 2016 at 03:39:27PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> >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 */
Hmm, I wonder why we did that, it seems a bit counter intuitive.
But the patch itself looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-25 8:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 5:39 [PATCH] xfs: fix superblock inprogress check Dave Chinner
2016-08-24 18:07 ` Brian Foster
2016-08-25 8:08 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.