You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
UPSTREAM: io_uring: allow re-poll if we made progress
commit10c873334fupstream. We currently check REQ_F_POLLED before arming async poll for a notification to retry. If it's set, then we don't allow poll and will punt to io-wq instead. This is done to prevent a situation where a buggy driver will repeatedly return that there's space/data available yet we get -EAGAIN. However, if we already transferred data, then it should be safe to rely on poll again. Gate the check on whether or not REQ_F_PARTIAL_IO is also set. Change-Id: I36b6d16ac43202fdf9ae5eea64f9dfbcfbe7fee5 Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org> Bug: 268174392 (cherry picked from commit4bc17e6381) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
a64d6ea01b
commit
63bf975936
@@ -5704,7 +5704,7 @@ static int io_arm_poll_handler(struct io_kiocb *req)
|
||||
|
||||
if (!req->file || !file_can_poll(req->file))
|
||||
return IO_APOLL_ABORTED;
|
||||
if (req->flags & REQ_F_POLLED)
|
||||
if ((req->flags & (REQ_F_POLLED|REQ_F_PARTIAL_IO)) == REQ_F_POLLED)
|
||||
return IO_APOLL_ABORTED;
|
||||
if (!def->pollin && !def->pollout)
|
||||
return IO_APOLL_ABORTED;
|
||||
@@ -5720,7 +5720,10 @@ static int io_arm_poll_handler(struct io_kiocb *req)
|
||||
mask |= POLLOUT | POLLWRNORM;
|
||||
}
|
||||
|
||||
apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC);
|
||||
if (req->flags & REQ_F_POLLED)
|
||||
apoll = req->apoll;
|
||||
else
|
||||
apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC);
|
||||
if (unlikely(!apoll))
|
||||
return IO_APOLL_ABORTED;
|
||||
apoll->double_poll = NULL;
|
||||
|
||||
Reference in New Issue
Block a user