UPSTREAM: io_uring: add flag for disabling provided buffer recycling
commit8a3e8ee564upstream. If we need to continue doing this IO, then we don't want a potentially selected buffer recycled. Add a flag for that. Set this for recv/recvmsg if they do partial IO. Change-Id: If9381bd6a5695c8c85c7a51c3adccc0dc09f8999 Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org> Bug: 268174392 (cherry picked from commit96ccba4a1a) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
45b2a34e21
commit
cf7ef78842
1 changed files with 5 additions and 0 deletions
|
|
@ -750,6 +750,7 @@ enum {
|
|||
REQ_F_CREDS_BIT,
|
||||
REQ_F_REFCOUNT_BIT,
|
||||
REQ_F_ARM_LTIMEOUT_BIT,
|
||||
REQ_F_PARTIAL_IO_BIT,
|
||||
/* keep async read/write and isreg together and in order */
|
||||
REQ_F_NOWAIT_READ_BIT,
|
||||
REQ_F_NOWAIT_WRITE_BIT,
|
||||
|
|
@ -805,6 +806,8 @@ enum {
|
|||
REQ_F_REFCOUNT = BIT(REQ_F_REFCOUNT_BIT),
|
||||
/* there is a linked timeout that has to be armed */
|
||||
REQ_F_ARM_LTIMEOUT = BIT(REQ_F_ARM_LTIMEOUT_BIT),
|
||||
/* request has already done partial IO */
|
||||
REQ_F_PARTIAL_IO = BIT(REQ_F_PARTIAL_IO_BIT),
|
||||
};
|
||||
|
||||
struct async_poll {
|
||||
|
|
@ -4973,6 +4976,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
|
|||
ret = -EINTR;
|
||||
if (ret > 0 && io_net_retry(sock, flags)) {
|
||||
sr->done_io += ret;
|
||||
req->flags |= REQ_F_PARTIAL_IO;
|
||||
return io_setup_async_msg(req, kmsg);
|
||||
}
|
||||
req_set_fail(req);
|
||||
|
|
@ -5046,6 +5050,7 @@ out_free:
|
|||
sr->len -= ret;
|
||||
sr->buf += ret;
|
||||
sr->done_io += ret;
|
||||
req->flags |= REQ_F_PARTIAL_IO;
|
||||
return -EAGAIN;
|
||||
}
|
||||
req_set_fail(req);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue