Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
- if (splice_grow_spd(pipe, &spd))
- return -ENOMEM;
-
if (*ppos & (PAGE_SIZE - 1))
return -EINVAL;
if (*ppos & (PAGE_SIZE - 1))
return -EINVAL;
+ if (splice_grow_spd(pipe, &spd))
+ return -ENOMEM;
+
again:
trace_access_lock(iter->cpu_file);
entries = ring_buffer_entries_cpu(iter->trace_buffer->buffer, iter->cpu_file);
again:
trace_access_lock(iter->cpu_file);
entries = ring_buffer_entries_cpu(iter->trace_buffer->buffer, iter->cpu_file);
/* did we read anything? */
if (!spd.nr_pages) {
if (ret)
/* did we read anything? */
if (!spd.nr_pages) {
if (ret)
if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK))
if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK))
ret = wait_on_pipe(iter, true);
if (ret)
ret = wait_on_pipe(iter, true);
if (ret)
goto again;
}
ret = splice_to_pipe(pipe, &spd);
goto again;
}
ret = splice_to_pipe(pipe, &spd);
splice_shrink_spd(&spd);
return ret;
splice_shrink_spd(&spd);
return ret;