public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: make iomap_begin functions trim iomaps consistently
Date: Wed, 6 Dec 2017 16:13:00 -0800	[thread overview]
Message-ID: <20171207001300.GP19219@magnolia> (raw)
In-Reply-To: <20171207000234.GA8602@infradead.org>

On Wed, Dec 06, 2017 at 04:02:34PM -0800, Christoph Hellwig wrote:
> On Wed, Dec 06, 2017 at 10:38:07AM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Historically, the XFS iomap_begin function only returned mappings for
> > exactly the range queried, i.e. it doesn't do XFS_BMAPI_ENTIRE lookups.
> > The current vfs iomap consumers are only set up to deal with trimmed
> > mappings.  xfs_xattr_iomap_begin does BMAPI_ENTIRE lookups, which is
> > inconsistent with the current iomap usage.  Remove the flag so that both
> > iomap_begin functions behave the same way.
> > 
> > FWIW this also fixes a behavioral regression in xattr FIEMAP that was
> > introduced in 4.8 wherein attr fork extents are no longer trimmed like
> > they used to be.
> 
> I would still prefer to trim in the iomap code.  But I'll need to find
> some time to look into that, so until then here is my reluctant ACK:

I started looking into that -- the iomap trimming is easy, but the data
fork iomap_begin (with a BMAPI_ENTIRE lookup) gets tripped up on
trimming the iomap around shared extents, because if we have an extent:
(R = regular, S = shared block)

01234567
RRRSSSSS

and we ask for iomap_begin(off=3, len=5) we return RRR (because we trim
to the first change in sharedness status) and not the SSSSS we expect and
then everything goes nuts.... so in the meantime we'll just restore the
old XFS behavior and bikeshed fiemap^W^Wclean it up later.

--D

> Reviewed-by: Christoph Hellwig <hch@lst.de>
> --
> 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-12-07  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 18:38 [PATCH] xfs: make iomap_begin functions trim iomaps consistently Darrick J. Wong
2017-12-07  0:02 ` Christoph Hellwig
2017-12-07  0:13   ` Darrick J. Wong [this message]

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=20171207001300.GP19219@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@infradead.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