Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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()
  • Loading branch information
Linus Torvalds committed Nov 27, 2016
2 parents e348031 + 8e54cad commit d8e435f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d8e435f

Please sign in to comment.