Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e54cada authored by Al Viro's avatar Al Viro
Browse files

fix default_file_splice_read()



Botched calculation of number of pages.  As the result,
we were dropping pieces when doing splice to pipe from
e.g. 9p.

Reported-by: default avatarAlexei Starovoitov <ast@kernel.org>
Tested-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3ad0e83c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -408,7 +408,8 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
	if (res <= 0)
		return -ENOMEM;

	nr_pages = res / PAGE_SIZE;
	BUG_ON(dummy);
	nr_pages = DIV_ROUND_UP(res, PAGE_SIZE);

	vec = __vec;
	if (nr_pages > PIPE_DEF_BUFFERS) {