linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 05/21] xfs: add BMAPI_NORMAP flag to perform block remapping without updating rmapbt
Date: Fri, 6 Apr 2018 09:41:42 -0700	[thread overview]
Message-ID: <20180406164142.GJ7500@magnolia> (raw)
In-Reply-To: <20180405230722.GJ23861@dastard>

On Fri, Apr 06, 2018 at 09:07:22AM +1000, Dave Chinner wrote:
> On Mon, Apr 02, 2018 at 12:56:47PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Add a new flag, XFS_BMAPI_NORMAP, which will perform file block
> > remapping without updating the rmapbt.  This will be used by the repair
> > code to reconstruct bmbts from the rmapbt, in which case we don't want
> > the rmapbt update.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  fs/xfs/libxfs/xfs_bmap.c |   25 ++++++++++++++++---------
> >  fs/xfs/libxfs/xfs_bmap.h |    6 +++++-
> >  2 files changed, 21 insertions(+), 10 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> > index 3b03d88..519ef9c 100644
> > --- a/fs/xfs/libxfs/xfs_bmap.c
> > +++ b/fs/xfs/libxfs/xfs_bmap.c
> > @@ -1998,9 +1998,12 @@ xfs_bmap_add_extent_delay_real(
> >  	}
> >  
> >  	/* add reverse mapping */
> > -	error = xfs_rmap_map_extent(mp, bma->dfops, bma->ip, whichfork, new);
> > -	if (error)
> > -		goto done;
> > +	if (!(bma->flags & XFS_BMAPI_NORMAP)) {
> > +		error = xfs_rmap_map_extent(mp, bma->dfops, bma->ip,
> > +				whichfork, new);
> > +		if (error)
> > +			goto done;
> > +	}
> 
> Double negatives are a bit hard to parse (not NORMAP) but I don't
> have a better idea for this.

Yeah.  I'll update the comment to read:

/* add reverse mapping unless caller opted out */

to hammer on the point that updating rmap is the default, and callers
have to explicitly turn that off.

> 
> ....
> 
> > @@ -4119,7 +4125,8 @@ xfs_bmapi_allocate(
> >  	else
> >  		error = xfs_bmap_add_extent_hole_real(bma->tp, bma->ip,
> >  				whichfork, &bma->icur, &bma->cur, &bma->got,
> > -				bma->firstblock, bma->dfops, &bma->logflags);
> > +				bma->firstblock, bma->dfops, &bma->logflags,
> > +				bma->flags);
> 
> Ob: The number of function parameters is starting to get out of hand
> again :/

I'd noticed.  TBH I've wondered why not just move whichfork into struct
xfs_bmalloca and then we can get rid of a lot of parameters and
whichfork passing?  Oh, right, because xfs_bmalloca.flags already has
XFS_BMAPI_{ATTR,COW}FORK so even that's unnecessary.

On the other hand bmapi_remap also calls _add_extent_hole_real, and it
(currently) doesn't create a xfs_bmalloca and maybe it's silly to make
it do that?

But that can be a cleanup patch for 4.18...

--D

> Regardless,
> 
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
> 
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> 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:[~2018-04-06 16:41 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 19:56 [PATCH v14.1 00/21] xfs: online repair support Darrick J. Wong
2018-04-02 19:56 ` [PATCH 01/21] xfs: add helpers to calculate btree size Darrick J. Wong
2018-04-02 19:56 ` [PATCH 02/21] xfs: expose various functions to repair code Darrick J. Wong
2018-04-02 19:56 ` [PATCH 03/21] xfs: add repair helpers for the reverse mapping btree Darrick J. Wong
2018-04-05 23:02   ` Dave Chinner
2018-04-06 16:31     ` Darrick J. Wong
2018-04-02 19:56 ` [PATCH 04/21] xfs: add repair helpers for the reference count btree Darrick J. Wong
2018-04-02 19:56 ` [PATCH 05/21] xfs: add BMAPI_NORMAP flag to perform block remapping without updating rmapbt Darrick J. Wong
2018-04-05 23:07   ` Dave Chinner
2018-04-06 16:41     ` Darrick J. Wong [this message]
2018-04-02 19:56 ` [PATCH 06/21] xfs: make xfs_bmapi_remapi work with attribute forks Darrick J. Wong
2018-04-05 23:12   ` Dave Chinner
2018-04-06 17:31     ` Darrick J. Wong
2018-04-02 19:56 ` [PATCH 07/21] xfs: halt auto-reclamation activities while rebuilding rmap Darrick J. Wong
2018-04-05 23:14   ` Dave Chinner
2018-04-02 19:57 ` [PATCH 08/21] xfs: create tracepoints for online repair Darrick J. Wong
2018-04-05 23:15   ` Dave Chinner
2018-04-02 19:57 ` [PATCH 09/21] xfs: implement the metadata repair ioctl flag Darrick J. Wong
2018-04-05 23:24   ` Dave Chinner
2018-04-02 19:57 ` [PATCH 10/21] xfs: add helper routines for the repair code Darrick J. Wong
2018-04-06  0:52   ` Dave Chinner
2018-04-07 17:55     ` Darrick J. Wong
2018-04-09  0:23       ` Dave Chinner
2018-04-09 17:19         ` Darrick J. Wong
2018-04-02 19:57 ` [PATCH 11/21] xfs: repair superblocks Darrick J. Wong
2018-04-06  1:05   ` Dave Chinner
2018-04-07 18:04     ` Darrick J. Wong
2018-04-09  0:26       ` Dave Chinner
2018-04-09 17:36         ` Darrick J. Wong
2018-04-02 19:57 ` [PATCH 12/21] xfs: repair the AGF and AGFL Darrick J. Wong
2018-04-02 19:57 ` [PATCH 13/21] xfs: repair the AGI Darrick J. Wong
2018-04-02 19:57 ` [PATCH 14/21] xfs: repair free space btrees Darrick J. Wong
2018-04-02 19:57 ` [PATCH 15/21] xfs: repair inode btrees Darrick J. Wong
2018-04-02 19:57 ` [PATCH 16/21] xfs: repair the rmapbt Darrick J. Wong
2018-04-02 19:58 ` [PATCH 17/21] xfs: repair refcount btrees Darrick J. Wong
2018-04-02 19:58 ` [PATCH 18/21] xfs: repair inode records Darrick J. Wong
2018-04-02 19:58 ` [PATCH 19/21] xfs: zap broken inode forks Darrick J. Wong
2018-04-02 19:58 ` [PATCH 20/21] xfs: repair inode block maps Darrick J. Wong
2018-04-02 19:58 ` [PATCH 21/21] xfs: repair damaged symlinks Darrick J. Wong

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=20180406164142.GJ7500@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.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;
as well as URLs for NNTP newsgroup(s).