From: "Darrick J. Wong" <djwong@kernel.org>
To: Brian Foster <bfoster@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
xfs <linux-xfs@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 1/2] iomap: don't bother unsharing delalloc extents
Date: Wed, 2 Oct 2024 09:57:09 -0700 [thread overview]
Message-ID: <20241002165709.GD21853@frogsfrogsfrogs> (raw)
In-Reply-To: <Zv1uQnLdM_GgIEo3@bfoster>
On Wed, Oct 02, 2024 at 12:01:06PM -0400, Brian Foster wrote:
> On Wed, Oct 02, 2024 at 08:00:40AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > If unshare encounters a delalloc reservation in the srcmap, that means
> > that the file range isn't shared because delalloc reservations cannot be
> > reflinked. Therefore, don't try to unshare them.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> > fs/iomap/buffered-io.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> > index 11ea747228aee..c1c559e0cc07c 100644
> > --- a/fs/iomap/buffered-io.c
> > +++ b/fs/iomap/buffered-io.c
> > @@ -1321,7 +1321,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
> > return length;
> >
> > /*
> > - * Don't bother with holes or unwritten extents.
> > + * Don't bother with delalloc reservations, holes or unwritten extents.
> > *
> > * Note that we use srcmap directly instead of iomap_iter_srcmap as
> > * unsharing requires providing a separate source map, and the presence
> > @@ -1330,6 +1330,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
> > * fork for XFS.
> > */
> > if (iter->srcmap.type == IOMAP_HOLE ||
> > + iter->srcmap.type == IOMAP_DELALLOC ||
> > iter->srcmap.type == IOMAP_UNWRITTEN)
> > return length;
> >
> >
>
> IIUC in the case of shared blocks srcmap always refers to the data fork
> (so delalloc in the COW fork is not an issue). If so:
Yep.
> Reviewed-by: Brian Foster <bfoster@redhat.com>
Thanks!
--D
next prev parent reply other threads:[~2024-10-02 16:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 15:00 [PATCH 1/2] iomap: don't bother unsharing delalloc extents Darrick J. Wong
2024-10-02 15:02 ` [PATCH 2/2] iomap: constrain the file range passed to iomap_file_unshare Darrick J. Wong
2024-10-02 15:15 ` Christoph Hellwig
2024-10-02 16:01 ` Brian Foster
2024-10-03 11:02 ` Julian Sun
2024-10-02 15:14 ` [PATCH 1/2] iomap: don't bother unsharing delalloc extents Christoph Hellwig
2024-10-02 16:01 ` Brian Foster
2024-10-02 16:57 ` Darrick J. Wong [this message]
2024-10-03 8:23 ` Christian Brauner
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=20241002165709.GD21853@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=bfoster@redhat.com \
--cc=brauner@kernel.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--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).