projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ad0e83
)
fix default_file_splice_read()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sun, 27 Nov 2016 01:05:42 +0000
(20:05 -0500)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Sun, 27 Nov 2016 01:05:42 +0000
(20:05 -0500)
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 <ast@kernel.org>
Tested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/splice.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/splice.c
b/fs/splice.c
index dcaf185a5731130ab67bd7076a9be26dd4f0d7f0..5a7750bd2eea765d06f5e8b76687701b24867c7b 100644
(file)
--- a/
fs/splice.c
+++ b/
fs/splice.c
@@
-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) {