]> www.infradead.org Git - users/hch/misc.git/commitdiff
Revert "io_uring/rw: drop -EOPNOTSUPP check in __io_complete_rw_common()"
authorJens Axboe <axboe@kernel.dk>
Mon, 13 Oct 2025 18:05:31 +0000 (12:05 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Oct 2025 18:16:40 +0000 (12:16 -0600)
This reverts commit 90bfb28d5fa8127a113a140c9791ea0b40ab156a.

Kevin reports that this commit causes an issue for him with LVM
snapshots, most likely because of turning off NOWAIT support while a
snapshot is being created. This makes -EOPNOTSUPP bubble back through
the completion handler, where io_uring read/write handling should just
retry it.

Reinstate the previous check removed by the referenced commit.

Cc: stable@vger.kernel.org
Fixes: 90bfb28d5fa8 ("io_uring/rw: drop -EOPNOTSUPP check in __io_complete_rw_common()")
Reported-by: Salvatore Bonaccorso <carnil@debian.org>
Reported-by: Kevin Lumik <kevin@xf.ee>
Link: https://lore.kernel.org/io-uring/cceb723c-051b-4de2-9a4c-4aa82e1619ee@kernel.dk/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c

index 08882648d56995e4671d40487b54cdb971063ab9..a0f9d2021e3f3f72bd699bcf84536c9a32d235e7 100644 (file)
@@ -542,7 +542,7 @@ static void __io_complete_rw_common(struct io_kiocb *req, long res)
 {
        if (res == req->cqe.res)
                return;
-       if (res == -EAGAIN && io_rw_should_reissue(req)) {
+       if ((res == -EOPNOTSUPP || res == -EAGAIN) && io_rw_should_reissue(req)) {
                req->flags |= REQ_F_REISSUE | REQ_F_BL_NO_RECYCLE;
        } else {
                req_set_fail(req);