aboutsummaryrefslogtreecommitdiffstats
diff options
authorChristoph Hellwig <hch@lst.de>2026-05-18 08:33:29 +0200
committerJens Axboe <axboe@kernel.dk>2026-05-26 11:01:55 -0600
commit38273e7b153d88562bddba9a24dafa733da4fd22 (patch)
tree9d4316962864a9de29482b96320f35ca50f04bb4
parentf73aa66dffcb8e61e78f01b56163ec16a15d06d2 (diff)
downloadlinux-next-history-38273e7b153d88562bddba9a24dafa733da4fd22.tar.gz
direct-io: remove IOCB_NOWAIT support
None of the file systems using the legacy direct I/O code actually sets FMODE_NOWAIT, and if they did this would not work, as the write locking could not handle the retry. Remove this dead code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christian Brauner <brauner@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://patch.msgid.link/20260518063336.507369-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/direct-io.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 2267f5ae7f77a..9e49767169855 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -502,12 +502,8 @@ static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio)
const enum req_op dio_op = dio->opf & REQ_OP_MASK;
bool should_dirty = dio_op == REQ_OP_READ && dio->should_dirty;
- if (err) {
- if (err == BLK_STS_AGAIN && (bio->bi_opf & REQ_NOWAIT))
- dio->io_error = -EAGAIN;
- else
- dio->io_error = -EIO;
- }
+ if (err)
+ dio->io_error = -EIO;
if (dio->is_async && should_dirty) {
bio_check_pages_dirty(bio); /* transfers ownership */
@@ -1178,13 +1174,10 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
dio->is_async = true;
dio->inode = inode;
- if (iov_iter_rw(iter) == WRITE) {
+ if (iov_iter_rw(iter) == WRITE)
dio->opf = REQ_OP_WRITE | REQ_SYNC | REQ_IDLE;
- if (iocb->ki_flags & IOCB_NOWAIT)
- dio->opf |= REQ_NOWAIT;
- } else {
+ else
dio->opf = REQ_OP_READ;
- }
/*
* For AIO O_(D)SYNC writes we need to defer completions to a workqueue