summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-06 21:42:51 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-08 13:07:00 -0700
commit0b5faf6ba7fb78bb1fe7336d23ea1978386a6c3a (patch)
treec914e31b45e69a9cde8a44136a036045de231fc4 /fs/io_uring.c
parentff002b30181d30cdfbca316dadd099c3ca0d739c (diff)
downloadlwn-0b5faf6ba7fb78bb1fe7336d23ea1978386a6c3a.tar.gz
lwn-0b5faf6ba7fb78bb1fe7336d23ea1978386a6c3a.zip
io_uring: allow AT_FDCWD for non-file openat/openat2/statx
Don't just check for dirfd == -1, we should allow AT_FDCWD as well for relative lookups. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 2a7bb178986e..e6247b94c29d 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4543,7 +4543,7 @@ static int io_req_needs_file(struct io_kiocb *req, int fd)
{
if (!io_op_defs[req->opcode].needs_file)
return 0;
- if (fd == -1 && io_op_defs[req->opcode].fd_non_neg)
+ if ((fd == -1 || fd == AT_FDCWD) && io_op_defs[req->opcode].fd_non_neg)
return 0;
return 1;
}