summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-10-18 11:17:37 +0200
committerJens Axboe <axboe@kernel.dk>2020-10-19 21:29:29 +0200
commit2e5aa6cb4d159f1785eee50e4bcc7e9ffd4e4690 (patch)
treeece4dfb017ba88a6ec6a24d8118d5e25b5570c2b /fs/io_uring.c
parentio_uring: use blk_queue_nowait() to check if NOWAIT supported (diff)
downloadlinux-2e5aa6cb4d159f1785eee50e4bcc7e9ffd4e4690.tar.xz
linux-2e5aa6cb4d159f1785eee50e4bcc7e9ffd4e4690.zip
io_uring: flags-based creds init in queue
Use IO_WQ_WORK_CREDS to figure out if req has creds to be used. Since recently it should rely only on flags, but not value of work.creds. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0f4a9c45061d..e9e8006fdf2e 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6191,7 +6191,8 @@ static void __io_queue_sqe(struct io_kiocb *req, struct io_comp_state *cs)
again:
linked_timeout = io_prep_linked_timeout(req);
- if ((req->flags & REQ_F_WORK_INITIALIZED) && req->work.identity->creds &&
+ if ((req->flags & REQ_F_WORK_INITIALIZED) &&
+ (req->work.flags & IO_WQ_WORK_CREDS) &&
req->work.identity->creds != current_cred()) {
if (old_creds)
revert_creds(old_creds);
@@ -6199,7 +6200,6 @@ again:
old_creds = NULL; /* restored original creds */
else
old_creds = override_creds(req->work.identity->creds);
- req->work.flags |= IO_WQ_WORK_CREDS;
}
ret = io_issue_sqe(req, true, cs);