Skip to content

Commit 2fb3e82

Browse files
isilenceaxboe
authored andcommitted
io_uring: punt splice async because of inode mutex
Nonblocking do_splice() still may wait for some time on an inode mutex. Let's play safe and always punt it async. Reported-by: Jens Axboe <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 4ee3631 commit 2fb3e82

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

fs/io_uring.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,15 +2768,6 @@ static int io_splice_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
27682768
return 0;
27692769
}
27702770

2771-
static bool io_splice_punt(struct file *file, int rw)
2772-
{
2773-
if (get_pipe_info(file))
2774-
return false;
2775-
if (!io_file_supports_async(file, rw))
2776-
return true;
2777-
return !(file->f_flags & O_NONBLOCK);
2778-
}
2779-
27802771
static int io_splice(struct io_kiocb *req, bool force_nonblock)
27812772
{
27822773
struct io_splice *sp = &req->splice;
@@ -2786,11 +2777,8 @@ static int io_splice(struct io_kiocb *req, bool force_nonblock)
27862777
loff_t *poff_in, *poff_out;
27872778
long ret;
27882779

2789-
if (force_nonblock) {
2790-
if (io_splice_punt(in, READ) || io_splice_punt(out, WRITE))
2791-
return -EAGAIN;
2792-
flags |= SPLICE_F_NONBLOCK;
2793-
}
2780+
if (force_nonblock)
2781+
return -EAGAIN;
27942782

27952783
poff_in = (sp->off_in == -1) ? NULL : &sp->off_in;
27962784
poff_out = (sp->off_out == -1) ? NULL : &sp->off_out;

0 commit comments

Comments
 (0)