All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: Brian Foster <bfoster@redhat.com>,
	linux-xfs@vger.kernel.org, edwin@etorok.net
Subject: [PATCH v2 0/9] xfs: reflink cleanups
Date: Wed, 24 Jun 2020 18:17:39 -0700	[thread overview]
Message-ID: <159304785928.874036.4735877085735285950.stgit@magnolia> (raw)

Hi all,

Here are a few patches cleaning up some problems with reflink.  The
first patch is the largest -- it reorganizes the remapping loop so that
instead of running one transaction for each extent in the source file
regardless of what's in the destination file, we look at both files to
find the longest extent we can swap in one go, and run a transaction for
just that piece.  This fixes a problem of running out of block
reservation when the filesystem is very fragmented.

The second patch fixes some goofiness in the reflink prep function, and
the third patch moves the "lock two inodes" code into xfs_inode.c since
none of that is related to reflink.

Mr. Torok: Could you try applying these patches to a recent kernel to
see if they fix the fs crash problems you were seeing with duperemove,
please?

v2: various cleanups suggested by Brian Foster

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=reflink-cleanups
---
 fs/xfs/libxfs/xfs_bmap.h     |   21 ++-
 fs/xfs/libxfs/xfs_rtbitmap.c |    2 
 fs/xfs/xfs_file.c            |    4 
 fs/xfs/xfs_inode.c           |   93 +++++++++++
 fs/xfs/xfs_inode.h           |    3 
 fs/xfs/xfs_reflink.c         |  352 +++++++++++++++++++-----------------------
 fs/xfs/xfs_reflink.h         |    2 
 fs/xfs/xfs_trace.h           |   52 ------
 8 files changed, 275 insertions(+), 254 deletions(-)


             reply	other threads:[~2020-06-25  1:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  1:17 Darrick J. Wong [this message]
2020-06-25  1:17 ` [PATCH 1/9] xfs: fix reflink quota reservation accounting error Darrick J. Wong
2020-06-25 12:26   ` Brian Foster
2020-07-01  8:07   ` Christoph Hellwig
2020-06-25  1:17 ` [PATCH 2/9] xfs: rename xfs_bmap_is_real_extent to is_written_extent Darrick J. Wong
2020-06-25 12:26   ` Brian Foster
2020-07-01  8:08   ` Christoph Hellwig
2020-06-25  1:17 ` [PATCH 3/9] xfs: redesign the reflink remap loop to fix blkres depletion crash Darrick J. Wong
2020-06-25 12:27   ` Brian Foster
2020-06-25 16:57     ` Darrick J. Wong
2020-06-25 17:23   ` [PATCH v4.2 " Darrick J. Wong
2020-06-26 11:57     ` Brian Foster
2020-06-26 16:40       ` Darrick J. Wong
2020-07-01  8:20     ` Christoph Hellwig
2020-06-25  1:18 ` [PATCH 4/9] xfs: only reserve quota blocks for bmbt changes if we're changing the data fork Darrick J. Wong
2020-06-25 12:27   ` Brian Foster
2020-07-01  8:21   ` Christoph Hellwig
2020-06-25  1:18 ` [PATCH 5/9] xfs: only reserve quota blocks if we're mapping into a hole Darrick J. Wong
2020-06-25 12:28   ` Brian Foster
2020-07-01  8:22   ` Christoph Hellwig
2020-06-25  1:18 ` [PATCH 6/9] xfs: reflink can skip remap existing mappings Darrick J. Wong
2020-06-25 12:28   ` Brian Foster
2020-06-25 16:49     ` Darrick J. Wong
2020-06-25  1:18 ` [PATCH 7/9] xfs: fix xfs_reflink_remap_prep calling conventions Darrick J. Wong
2020-07-01  8:23   ` Christoph Hellwig
2020-06-25  1:18 ` [PATCH 8/9] xfs: refactor locking and unlocking two inodes against userspace IO Darrick J. Wong
2020-07-01  8:26   ` Christoph Hellwig
2020-06-25  1:18 ` [PATCH 9/9] xfs: move helpers that lock and unlock " Darrick J. Wong
2020-07-01  8:27   ` Christoph Hellwig
2020-06-28 12:06 ` [PATCH v2 0/9] xfs: reflink cleanups Edwin Török
2020-06-28 22:36   ` 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=159304785928.874036.4735877085735285950.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=edwin@etorok.net \
    --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 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.