public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix superblock inprogress check
Date: Wed, 24 Aug 2016 14:07:38 -0400	[thread overview]
Message-ID: <20160824180738.GB8982@bfoster.bfoster> (raw)
In-Reply-To: <1471844367-9679-1-git-send-email-david@fromorbit.com>

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

  reply	other threads:[~2016-08-24 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22  5:39 [PATCH] xfs: fix superblock inprogress check Dave Chinner
2016-08-24 18:07 ` Brian Foster [this message]
2016-08-25  8:08 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160824180738.GB8982@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox