* [PATCH] iomap: don't make REQ_POLLED imply REQ_NOWAIT
@ 2026-05-18 6:29 Christoph Hellwig
2026-05-18 12:23 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2026-05-18 6:29 UTC (permalink / raw)
To: brauner; +Cc: djwong, axboe, linux-xfs, linux-fsdevel, linux-block
As described in commit 2bc057692599 ("block: don't make REQ_POLLED imply
REQ_NOWAIT"), which fixed the same issue for the block device node, there
are valid cases to poll for I/O completion without REQ_NOWAIT.
Additionally, sing REQ_NOWAIT for file system writes is currently not
supported as file systems writes are not idempotent and would need a
retry of just the bio and not the entire operation to be fully supported.
Switch iomap to set REQ_POLLED and remove the now unused bio_set_polled
helper.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/iomap/direct-io.c | 2 +-
include/linux/bio.h | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b0a6549b3848..db16f21446f7 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -69,7 +69,7 @@ static void iomap_dio_submit_bio(const struct iomap_iter *iter,
/* Sync dio can't be polled reliably */
if ((iocb->ki_flags & IOCB_HIPRI) && !is_sync_kiocb(iocb)) {
- bio_set_polled(bio, iocb);
+ bio->bi_opf |= REQ_POLLED;
WRITE_ONCE(iocb->private, bio);
}
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 85463981d0f5..6b0ad28387b8 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -695,20 +695,6 @@ static inline bool bioset_initialized(struct bio_set *bs)
return bs->bio_slab != NULL;
}
-/*
- * Mark a bio as polled. Note that for async polled IO, the caller must
- * expect -EWOULDBLOCK if we cannot allocate a request (or other resources).
- * We cannot block waiting for requests on polled IO, as those completions
- * must be found by the caller. This is different than IRQ driven IO, where
- * it's safe to wait for IO to complete.
- */
-static inline void bio_set_polled(struct bio *bio, struct kiocb *kiocb)
-{
- bio->bi_opf |= REQ_POLLED;
- if (kiocb->ki_flags & IOCB_NOWAIT)
- bio->bi_opf |= REQ_NOWAIT;
-}
-
static inline void bio_clear_polled(struct bio *bio)
{
bio->bi_opf &= ~REQ_POLLED;
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iomap: don't make REQ_POLLED imply REQ_NOWAIT
2026-05-18 6:29 [PATCH] iomap: don't make REQ_POLLED imply REQ_NOWAIT Christoph Hellwig
@ 2026-05-18 12:23 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-05-18 12:23 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Christian Brauner, djwong, axboe, linux-xfs, linux-fsdevel,
linux-block
On Mon, 18 May 2026 08:29:13 +0200, Christoph Hellwig wrote:
> As described in commit 2bc057692599 ("block: don't make REQ_POLLED imply
> REQ_NOWAIT"), which fixed the same issue for the block device node, there
> are valid cases to poll for I/O completion without REQ_NOWAIT.
>
> Additionally, sing REQ_NOWAIT for file system writes is currently not
> supported as file systems writes are not idempotent and would need a
> retry of just the bio and not the entire operation to be fully supported.
>
> [...]
Applied to the vfs-7.2.iomap branch of the vfs/vfs.git tree.
Patches in the vfs-7.2.iomap branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.2.iomap
[1/1] iomap: don't make REQ_POLLED imply REQ_NOWAIT
https://git.kernel.org/vfs/vfs/c/47f28b493daf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-18 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 6:29 [PATCH] iomap: don't make REQ_POLLED imply REQ_NOWAIT Christoph Hellwig
2026-05-18 12:23 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox