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
index 2f7b7783bd6b207da7c39778a43654f76f6d93b8,6b965efe215e80696a52d73bebe26b4b64bf902c..849f459ad0780e27bc256ff13fd52fa8c9007661
@@@ -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);
                }