Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Christoph Hellwig <hch@infradead.org>, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v3 3/4] iomap: reject NOWAIT and BOUNCE direct IOs
Date: Mon, 15 Jun 2026 22:19:46 -0700	[thread overview]
Message-ID: <ajDc8nFYyiQ66TOR@infradead.org> (raw)
In-Reply-To: <8a0e1881-fe73-4912-95f9-8eac998840d5@gmx.com>

On Tue, Jun 16, 2026 at 10:30:27AM +0930, Qu Wenruo wrote:
> After scanning the code for related memory allocation, there are some other
> locations doing memory allocation, including but not limited to:
> 
> - iomap_dio_alloc_bio()
>   This one is a little tricky, if we pass GFP_NOWAIT, we can break the
>   old assumption that the function will always return a bio.
> 
> - fscrypt_set_bio_crypt_ctx()
>   This one is fine so far, as neither XFS nor btrfs support fscrypt yet.
> 
> And any memory allocation failure in NOWAIT mode should return -EAGAIN, not
> -ENOMEM so that the caller can retry in blocking mode as a fallback.
> 
> To me, considering NOWAIT itself is only an optimistic flag, and caller
> should always have a blocking mode as fallback, I'd prefer to reject NOWAIT
> + BOUNCE direct writes completely inside btrfs for now.

If you want to do that in btrfs please do it there.

> And leave all the missing NOWAIT handling in iomap in a dedicated series.

This might be worth looking into.


  reply	other threads:[~2026-06-16  5:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12  9:51 [PATCH v3 0/4] btrfs: use IOMAP_DIO_BOUNCE flag instead of falling back to buffered IO Qu Wenruo
2026-06-12  9:51 ` [PATCH v3 1/4] block: revert the iov_iter after a short copy in bio_iov_iter_bounce_write() Qu Wenruo
2026-06-15 15:03   ` Christoph Hellwig
2026-06-12  9:51 ` [PATCH v3 2/4] block: respect iov_iter::nofault flag " Qu Wenruo
2026-06-15 15:05   ` Christoph Hellwig
2026-06-12  9:51 ` [PATCH v3 3/4] iomap: reject NOWAIT and BOUNCE direct IOs Qu Wenruo
2026-06-15 15:05   ` Christoph Hellwig
2026-06-15 22:43     ` Qu Wenruo
2026-06-16  1:00       ` Qu Wenruo
2026-06-16  5:19         ` Christoph Hellwig [this message]
2026-06-16  5:18       ` Christoph Hellwig
2026-06-12  9:51 ` [PATCH v3 4/4] btrfs: use IOMAP_DIO_BOUNCE flag instead of falling back to buffered IO Qu Wenruo

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=ajDc8nFYyiQ66TOR@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.com \
    /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