Skip to content

Commit 8835758

Browse files
committed
io_uring: correct O_NONBLOCK check for splice punt
The splice file punt check uses file->f_mode to check for O_NONBLOCK, but it should be checking file->f_flags. This leads to punting even for files that have O_NONBLOCK set, which isn't necessary. This equates to checking for FMODE_PATH, which will never be set on the fd in question. Fixes: 7d67af2 ("io_uring: add splice(2) support") Signed-off-by: Jens Axboe <[email protected]>
1 parent b1f573b commit 8835758

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2763,7 +2763,7 @@ static bool io_splice_punt(struct file *file)
27632763
return false;
27642764
if (!io_file_supports_async(file))
27652765
return true;
2766-
return !(file->f_mode & O_NONBLOCK);
2766+
return !(file->f_flags & O_NONBLOCK);
27672767
}
27682768

27692769
static int io_splice(struct io_kiocb *req, bool force_nonblock)

0 commit comments

Comments
 (0)