From: Christoph Hellwig <hch@lst.de>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
linux-xfs@vger.kernel.org, darrick.wong@oracle.com
Subject: Re: [PATCH 6/9] xfs: refactor xfs_bunmapi_cow
Date: Mon, 17 Oct 2016 19:44:11 +0200 [thread overview]
Message-ID: <20161017174411.GA22930@lst.de> (raw)
In-Reply-To: <20161017172103.GH12736@bfoster.bfoster>
On Mon, Oct 17, 2016 at 01:21:03PM -0400, Brian Foster wrote:
> On Sat, Oct 15, 2016 at 10:52:31AM +0200, Christoph Hellwig wrote:
> > Split out two helpers for deleting delayed or real extents from the COW fork.
> > This allows to call them directly from xfs_reflink_cow_end_io once that
> > function is refactored to iterate the extent tree. It will also allow
> > to reuse the delalloc deletion from xfs_bunmapi in the future.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > Reviewed-by: Brian Foster <bfoster@redhat.com>
> > ---
> > fs/xfs/libxfs/xfs_bmap.c | 374 ++++++++++++++++++++++++++++-------------------
> > fs/xfs/libxfs/xfs_bmap.h | 5 +
> > fs/xfs/xfs_reflink.c | 5 -
> > 3 files changed, 225 insertions(+), 159 deletions(-)
> >
> ...
> > diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> > index 5d230ea..f33f737 100644
> > --- a/fs/xfs/xfs_reflink.c
> > +++ b/fs/xfs/xfs_reflink.c
> > @@ -535,11 +535,6 @@ xfs_reflink_cancel_cow_blocks(
> > trace_xfs_reflink_cancel_cow(ip, &irec);
> >
> > if (irec.br_startblock == DELAYSTARTBLOCK) {
> > - /* Free a delayed allocation. */
> > - xfs_mod_fdblocks(ip->i_mount, irec.br_blockcount,
> > - false);
>
> Don't we still need this call, or am I missing where it exists
> elsewhere? Also, IIRC we might need to make sure this occurs after
> xfs_bunmapi_cow() since the latter can steal blocks from the deleted
> extent for indirect blocks (e.g., where we call
> xfs_bmap_split_indlen()).
xfs_bmap_del_extent_delay is now taking care of this:
+ ASSERT(da_old >= da_new);
+ da_diff = da_old - da_new;
+ if (!isrt)
+ da_diff += del->br_blockcount;
+ if (da_diff)
+ xfs_mod_fdblocks(mp, da_diff, false);
+ return error;
Note that the old code also was buggy if for some reason
the cancellation was for a partial cow extent.
next prev parent reply other threads:[~2016-10-17 17:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 8:52 optimize the COW I/O path V2 Christoph Hellwig
2016-10-15 8:52 ` [PATCH 1/9] iomap: add IOMAP_REPORT Christoph Hellwig
2016-10-17 15:35 ` Brian Foster
2016-10-17 16:18 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 2/9] xfs: add xfs_trim_extent Christoph Hellwig
2016-10-17 15:35 ` Brian Foster
2016-10-17 16:27 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 3/9] xfs: handle "raw" delayed extents xfs_reflink_trim_around_shared Christoph Hellwig
2016-10-17 15:35 ` Brian Foster
2016-10-17 16:27 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 4/9] xfs: don't bother looking at the refcount tree for reads Christoph Hellwig
2016-10-17 15:36 ` Brian Foster
2016-10-17 16:41 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 5/9] xfs: optimize writes to reflink files Christoph Hellwig
2016-10-17 17:19 ` Brian Foster
2016-10-17 17:34 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 6/9] xfs: refactor xfs_bunmapi_cow Christoph Hellwig
2016-10-17 17:21 ` Brian Foster
2016-10-17 17:44 ` Christoph Hellwig [this message]
2016-10-17 17:53 ` Brian Foster
2016-10-17 18:32 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 7/9] xfs: optimize xfs_reflink_cancel_cow_blocks Christoph Hellwig
2016-10-17 17:52 ` Brian Foster
2016-10-17 18:33 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 8/9] xfs: optimize xfs_reflink_end_cow Christoph Hellwig
2016-10-17 17:53 ` Brian Foster
2016-10-17 18:34 ` Darrick J. Wong
2016-10-15 8:52 ` [PATCH 9/9] xfs: remove xfs_bunmapi_cow Christoph Hellwig
2016-10-17 17:53 ` Brian Foster
2016-10-17 18:34 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2016-10-10 13:37 optimize the COW I/O path Christoph Hellwig
2016-10-10 13:38 ` [PATCH 6/9] xfs: refactor xfs_bunmapi_cow Christoph Hellwig
2016-10-12 14:13 ` Brian Foster
2016-10-13 6:54 ` Christoph Hellwig
2016-10-13 13:26 ` Brian Foster
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=20161017174411.GA22930@lst.de \
--to=hch@lst.de \
--cc=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;
as well as URLs for NNTP newsgroup(s).