All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v4 5/6] xfs: create delalloc bmapi wrapper for full extent allocation
Date: Sat, 2 Feb 2019 08:08:32 -0800	[thread overview]
Message-ID: <20190202160832.GA12373@infradead.org> (raw)
In-Reply-To: <20190201143256.43232-6-bfoster@redhat.com>

On Fri, Feb 01, 2019 at 09:32:55AM -0500, Brian Foster wrote:
> The writeback delalloc conversion code is racy with respect to
> changes in the currently cached file mapping. This stems from the
> fact that the bmapi allocation code requires a file range to
> allocate and the writeback conversion code assumes the range of the
> currently cached mapping is still valid with respect to the fork. It
> may not be valid, however, because the ilock is cycled (potentially
> multiple times) between the time the cached mapping was populated
> and the delalloc conversion occurs.
> 
> To facilitate a solution to this problem, create a new
> xfs_bmapi_delalloc() wrapper to xfs_bmapi_write() that takes a file
> (FSB) offset and attempts to allocate whatever delalloc extent backs
> the offset. Use a new bmapi flag to cause xfs_bmapi_write() to set
> the range based on the extent backing the bno parameter unless bno
> lands in a hole. If bno does land in a hole, fall back to the
> current behavior (which may result in an error or quietly skipping
> holes in the specified range depending on other parameters). This
> patch does not change behavior.
> 
> [hch: Rename helper function and tweak interface.]
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.  Feel free to drop the [hch: ] note and replace my
signoff for that with a:

Reviewed-by: Christoph Hellwig <hch@lst.de>

for the whole patch.

  reply	other threads:[~2019-02-02 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01 14:32 [PATCH v4 0/6] xfs: properly invalidate cached writeback mapping Brian Foster
2019-02-01 14:32 ` [PATCH v4 1/6] xfs: eof trim writeback mapping as soon as it is cached Brian Foster
2019-02-01 14:32 ` [PATCH v4 2/6] xfs: update fork seq counter on data fork changes Brian Foster
2019-02-01 14:32 ` [PATCH v4 3/6] xfs: validate writeback mapping using data fork seq counter Brian Foster
2019-02-01 14:32 ` [PATCH v4 4/6] xfs: remove superfluous writeback mapping eof trimming Brian Foster
2019-02-01 14:32 ` [PATCH v4 5/6] xfs: create delalloc bmapi wrapper for full extent allocation Brian Foster
2019-02-02 16:08   ` Christoph Hellwig [this message]
2019-02-01 14:32 ` [PATCH v4 6/6] xfs: use the latest extent at writeback delalloc conversion time Brian Foster
2019-02-02 16:09   ` Christoph Hellwig

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=20190202160832.GA12373@infradead.org \
    --to=hch@infradead.org \
    --cc=bfoster@redhat.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 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.