public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 6/9] xfs: skip bmbt block ino validation during owner change
Date: Fri, 25 Aug 2017 14:11:29 -0400	[thread overview]
Message-ID: <20170825181129.GB40964@bfoster.bfoster> (raw)
In-Reply-To: <20170825153553.GM4796@magnolia>

On Fri, Aug 25, 2017 at 08:35:53AM -0700, Darrick J. Wong wrote:
> On Fri, Aug 25, 2017 at 11:05:54AM -0400, Brian Foster wrote:
> > Extent swap uses xfs_btree_visit_blocks() to fix up bmbt block
> > owners on v5 (!rmapbt) filesystems. The bmbt scan uses
> > xfs_btree_lookup_get_block() to read bmbt blocks which verifies the
> > current owner of the block against the parent inode of the bmbt.
> > This works during extent swap because the bmbt owners are updated to
> > the opposite inode number before the inode extent forks are swapped.
> > 
> > The modified bmbt blocks are marked as ordered buffers which allows
> > everything to commit in a single transaction. If the transaction
> > commits to the log and the system crashes such that recovery of the
> > extent swap is required, log recovery restarts the bmbt scan to fix
> > up any bmbt blocks that may have not been written back before the
> > crash. The log recovery bmbt scan occurs after the inode forks have
> > been swapped, however. This causes the bmbt block owner verification
> > to fail, leads to log recovery failure and requires xfs_repair to
> > zap the log to recover.
> > 
> > Define a new invalid inode owner flag to inform the btree block
> > lookup mechanism that the current inode may be invalid with respect
> > to the current owner of the bmbt block. Set this flag on the cursor
> > used for change owner scans to allow this operation to work at
> > runtime and during log recovery.
> > 
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > ---
> >  fs/xfs/libxfs/xfs_bmap_btree.c | 1 +
> >  fs/xfs/libxfs/xfs_btree.c      | 1 +
> >  fs/xfs/libxfs/xfs_btree.h      | 3 ++-
> >  3 files changed, 4 insertions(+), 1 deletion(-)
> > 
...
> > diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> > index 9c95e96..c803ddc 100644
> > --- a/fs/xfs/libxfs/xfs_btree.h
> > +++ b/fs/xfs/libxfs/xfs_btree.h
> > @@ -233,7 +233,8 @@ typedef struct xfs_btree_cur
> >  			short		forksize;	/* fork's inode space */
> >  			char		whichfork;	/* data or attr fork */
> >  			char		flags;		/* flags */
> > -#define	XFS_BTCUR_BPRV_WASDEL	1			/* was delayed */
> > +#define	XFS_BTCUR_BPRV_WASDEL		(1<<0)		/* was delayed */
> > +#define	XFS_BTCUR_BPRV_INVALIDINO	(1<<1)		/* for ext swap */
> 
> I think I'd call this invalid owner since that's the name of the field
> that we're (not) validating.
> 

Sure, I'll change it to XFS_BTCUR_BPRV_INVALID_OWNER unless I hear
otherwise and incorporate the other cleanups for v2. Thanks for the
reviews.

Brian

> Otherwise looks fine,
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> --D
> 
> >  		} b;
> >  	}		bc_private;	/* per-btree type data */
> >  } xfs_btree_cur_t;
> > -- 
> > 2.9.5
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-08-25 18:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 15:05 [PATCH 0/9] xfs: xfs: refactor ordered buffer logging code Brian Foster
2017-08-25 15:05 ` [PATCH 1/9] xfs: open-code xfs_buf_item_dirty() Brian Foster
2017-08-25 15:26   ` Darrick J. Wong
2017-08-28  9:20   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 2/9] xfs: remove unnecessary dirty bli format check for ordered bufs Brian Foster
2017-08-25 15:51   ` Darrick J. Wong
2017-08-28  9:25   ` Christoph Hellwig
2017-08-28 10:51     ` Brian Foster
2017-08-25 15:05 ` [PATCH 3/9] xfs: ordered buffer log items are never formatted Brian Foster
2017-08-25 15:26   ` Darrick J. Wong
2017-08-28  9:26   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 4/9] xfs: refactor buffer logging into buffer dirtying helper Brian Foster
2017-08-28  9:28   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 5/9] xfs: don't log dirty ranges for ordered buffers Brian Foster
2017-08-25 15:51   ` Darrick J. Wong
2017-08-28  9:29   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 6/9] xfs: skip bmbt block ino validation during owner change Brian Foster
2017-08-25 15:35   ` Darrick J. Wong
2017-08-25 18:11     ` Brian Foster [this message]
2017-08-28  9:44   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 7/9] xfs: move bmbt owner change to last step of extent swap Brian Foster
2017-08-25 15:57   ` Darrick J. Wong
2017-08-28  9:46   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 8/9] xfs: disallow marking previously dirty buffers as ordered Brian Foster
2017-08-25 16:50   ` Darrick J. Wong
2017-08-28  9:34   ` Christoph Hellwig
2017-08-25 15:05 ` [PATCH 9/9] xfs: relog dirty buffers during swapext bmbt owner change Brian Foster
2017-08-25 16:53   ` Darrick J. Wong
2017-08-28  9:51   ` 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=20170825181129.GB40964@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /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