From: John Garry <john.garry@linux.dev>
To: Christoph Hellwig <hch@lst.de>, Fengnan <changfengnan@bytedance.com>
Cc: Christian Brauner <brauner@kernel.org>,
"Darrick J . Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-ext4@vger.kernel.org, tom.leiming@gmail.com
Subject: Re: [PATCH] iomap: disable I/O polling when direct I/O must wait
Date: Wed, 2 Dec 2026 09:20:26 +0000 [thread overview]
Message-ID: <903f1523-bfa3-4cbd-9b46-9e4f7cd153e4@linux.dev> (raw)
In-Reply-To: <20261202082008.GA5166@lst.de>
On 12/2/26 08:20, Christoph Hellwig wrote:
> bio->bi_end_io = iomap_dio_bio_end_io;
>
> @@ -368,15 +361,26 @@ static ssize_t iomap_dio_bio_iter_one(struct iomap_iter *iter,
> bdev_dma_alignment(bio->bi_bdev), alignment - 1);
> if (unlikely(ret))
> goto out_put_bio;
> - ret = bio->bi_iter.bi_size;
>
> - /*
> - * An atomic write bio must cover the complete length. If it doesn't,
> - * error out.
> - */
> - if ((op & REQ_ATOMIC) && WARN_ON_ONCE(ret != iomap_length(iter))) {
> - ret = -EINVAL;
> - goto out_bio_release_pages;
> + if (pos == iocb->ki_pos && bio->bi_iter.bi_size == iomap_length(iter)) {
> + /*
> + * Only async bios can be polled, and polling is only supported
> + * for single bio per kiocb.
> + */
> + if ((iocb->ki_flags & IOCB_HIPRI) &&
> + !dio->wait_for_completion) {
> + bio->bi_opf |= REQ_POLLED;
> + WRITE_ONCE(iocb->private, bio);
> + }
> + } else {
> + /*
> + * An atomic write bio must cover the complete length. If it
> + * doesn't, error out.
> + */
> + if (WARN_ON_ONCE(op & REQ_ATOMIC)) {
> + ret = -EINVAL;
> + goto out_bio_release_pages;
> + }
Note that we are still hoping to remove this now-duplicated check:
https://lore.kernel.org/linux-fsdevel/20261107-blkdev-atomic-bounce-v1-2-f66344262096@columbia.edu/
Thanks,
John
> }
prev parent reply other threads:[~2026-12-02 9:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 3:49 [PATCH] iomap: disable I/O polling when direct I/O must wait Fengnan Chang
2026-12-01 8:08 ` Christoph Hellwig
2026-12-01 8:48 ` Fengnan Chang
2026-12-01 13:25 ` Christian Brauner
2026-12-01 13:26 ` Christian Brauner
2026-12-02 1:56 ` Fengnan
2026-12-02 7:53 ` Fengnan
2026-12-02 8:20 ` Christoph Hellwig
2026-12-02 8:43 ` changfengnan
2026-12-02 9:20 ` John Garry [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=903f1523-bfa3-4cbd-9b46-9e4f7cd153e4@linux.dev \
--to=john.garry@linux.dev \
--cc=brauner@kernel.org \
--cc=changfengnan@bytedance.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=tom.leiming@gmail.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