提交 c968d1d8 编写于 作者: J Jens Axboe 提交者: Zheng Zengkai

io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return

stable inclusion
from stable-5.10.26
commit 76f496681d6a125d28321deda355ca14d0e4ad23
bugzilla: 51363

--------------------------------

[ Upstream commit b5b0ecb7 ]

The callback can only be armed, if we get -EIOCBQUEUED returned. It's
important that we clear the WAITQ bit for other cases, otherwise we can
queue for async retry and filemap will assume that we're armed and
return -EAGAIN instead of just blocking for the IO.

Cc: stable@vger.kernel.org # 5.9+
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 99f98c5a
......@@ -3501,6 +3501,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
goto out_free;
} else if (ret > 0 && ret < io_size) {
/* we got some bytes, but not all. retry. */
kiocb->ki_flags &= ~IOCB_WAITQ;
goto retry;
}
done:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册