Skip to content

Commit d8e435f

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs splice fix from Al Viro. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix default_file_splice_read()
2 parents e348031 + 8e54cad commit d8e435f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/splice.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
408408
if (res <= 0)
409409
return -ENOMEM;
410410

411-
nr_pages = res / PAGE_SIZE;
411+
BUG_ON(dummy);
412+
nr_pages = DIV_ROUND_UP(res, PAGE_SIZE);
412413

413414
vec = __vec;
414415
if (nr_pages > PIPE_DEF_BUFFERS) {

0 commit comments

Comments
 (0)