]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN
authorJens Axboe <axboe@kernel.dk>
Tue, 10 Sep 2024 14:30:57 +0000 (08:30 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Sep 2024 15:34:41 +0000 (09:34 -0600)
commitc0a9d496e0fece67db777bd48550376cf2960c47
tree8e28049a1c91d18299f41d35b9bc75230c76f785
parentf011c9cf04c06f16b24f583d313d3c012e589e50
io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN

Some file systems, ocfs2 in this case, will return -EOPNOTSUPP for
an IOCB_NOWAIT read/write attempt. While this can be argued to be
correct, the usual return value for something that requires blocking
issue is -EAGAIN.

A refactoring io_uring commit dropped calling kiocb_done() for
negative return values, which is otherwise where we already do that
transformation. To ensure we catch it in both spots, check it in
__io_read() itself as well.

Reported-by: Robert Sander <r.sander@heinlein-support.de>
Link: https://fosstodon.org/@gurubert@mastodon.gurubert.de/113112431889638440
Cc: stable@vger.kernel.org
Fixes: a08d195b586a ("io_uring/rw: split io_read() into a helper")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c