mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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: Alexei Starovoitov <[email protected]> Tested-by: Alexei Starovoitov <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
3ad0e83cf8
commit
8e54cadab4
1 changed files with 2 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue