Skip to content

Commit 6fbdce3

Browse files
axboegregkh
authored andcommitted
io_uring: don't mark S_ISBLK async work as unbounded
[ Upstream commit 4b982bd ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5d46000 commit 6fbdce3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/io_uring.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ static void io_prep_async_work(struct io_kiocb *req)
14391439
if (req->flags & REQ_F_ISREG) {
14401440
if (def->hash_reg_file || (ctx->flags & IORING_SETUP_IOPOLL))
14411441
io_wq_hash_work(&req->work, file_inode(req->file));
1442-
} else {
1442+
} else if (!req->file || !S_ISBLK(file_inode(req->file)->i_mode)) {
14431443
if (def->unbound_nonreg_file)
14441444
req->work.flags |= IO_WQ_WORK_UNBOUND;
14451445
}

0 commit comments

Comments
 (0)