summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-04-01 17:38:34 +0300
committerJens Axboe <axboe@kernel.dk>2021-04-01 17:56:28 +0300
commit4b982bd0f383db9132e892c0c5144117359a6289 (patch)
tree9b069f16d20a21e408f6d3821372f0c7acdf9d3d /fs/io_uring.c
parent82734c5b1b24c020d701cf90ccb075e43a5ccb07 (diff)
downloadlinux-4b982bd0f383db9132e892c0c5144117359a6289.tar.xz
io_uring: don't mark S_ISBLK async work as unbounded
S_ISBLK is marked as unbounded work for async preparation, because it doesn't match S_ISREG. That is incorrect, as any read/write to a block device is also a bounded operation. Fix it up and ensure that S_ISBLK isn't marked unbounded. 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 6d7a1b69712b..a16b7df934d1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1213,7 +1213,7 @@ static void io_prep_async_work(struct io_kiocb *req)
if (req->flags & REQ_F_ISREG) {
if (def->hash_reg_file || (ctx->flags & IORING_SETUP_IOPOLL))
io_wq_hash_work(&req->work, file_inode(req->file));
- } else {
+ } else if (!req->file || !S_ISBLK(file_inode(req->file)->i_mode)) {
if (def->unbound_nonreg_file)
req->work.flags |= IO_WQ_WORK_UNBOUND;
}