Merge branch 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 Oct 2016 20:38:49 +0000 (13:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 Oct 2016 20:38:49 +0000 (13:38 -0700)
Pull splice fixups from Al Viro:
 "A couple of fixups for interaction of pipe-backed iov_iter with
  O_DIRECT reads + constification of a couple of primitives in uio.h
  missed by previous rounds.

  Kudos to davej - his fuzzing has caught those bugs"

* 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  [btrfs] fix check_direct_IO() for non-iovec iterators
  constify iov_iter_count() and iter_is_iovec()
  fix ITER_PIPE interaction with direct_IO

1  2 
fs/btrfs/inode.c
fs/xfs/xfs_file.c
include/linux/uio.h
mm/filemap.c

Simple merge
Simple merge
Simple merge
diff --cc mm/filemap.c
@@@ -1935,13 -1915,12 +1935,13 @@@ generic_file_read_iter(struct kiocb *io
                size = i_size_read(inode);
                retval = filemap_write_and_wait_range(mapping, iocb->ki_pos,
                                        iocb->ki_pos + count - 1);
 -              if (!retval) {
 -                      struct iov_iter data = *iter;
 -                      retval = mapping->a_ops->direct_IO(iocb, &data);
 -              }
 +              if (retval < 0)
 +                      goto out;
  
-               if (retval > 0) {
 +              file_accessed(file);
 +
 +              retval = mapping->a_ops->direct_IO(iocb, &data);
+               if (retval >= 0) {
                        iocb->ki_pos += retval;
                        iov_iter_advance(iter, retval);
                }