Sfoglia il codice sorgente

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>
Steven Rostedt (Red Hat) 12 anni fa
parent
commit
189e5784f6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      kernel/trace/trace.c

+ 1 - 1
kernel/trace/trace.c

@@ -4593,7 +4593,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
 
 
 	/* did we read anything? */
 	/* did we read anything? */
 	if (!spd.nr_pages) {
 	if (!spd.nr_pages) {
-		if (flags & SPLICE_F_NONBLOCK)
+		if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK))
 			ret = -EAGAIN;
 			ret = -EAGAIN;
 		else
 		else
 			ret = 0;
 			ret = 0;