Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracing: Do not block on splice if either file or splice NONBLOCK flag is set

Currently only the splice NONBLOCK flag is checked to determine if
the splice read should block or not. But the file descriptor NONBLOCK
flag also needs to be checked.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

+1 -1
+1 -1
kernel/trace/trace.c
··· 4593 4593 4594 4594 /* did we read anything? */ 4595 4595 if (!spd.nr_pages) { 4596 - if (flags & SPLICE_F_NONBLOCK) 4596 + if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK)) 4597 4597 ret = -EAGAIN; 4598 4598 else 4599 4599 ret = 0;