]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge tag 'xfs-4.14-fixes-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Oct 2017 18:51:50 +0000 (14:51 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Oct 2017 18:51:50 +0000 (14:51 -0400)
Pull xfs fixes from Darrick Wong:

 - fix some more CONFIG_XFS_RT related build problems

 - fix data loss when writeback at eof races eofblocks gc and loses

 - invalidate page cache after fs finishes a dio write

 - remove dirty page state when invalidating pages so releasepage does
   the right thing when handed a dirty page

* tag 'xfs-4.14-fixes-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: move two more RT specific functions into CONFIG_XFS_RT
  xfs: trim writepage mapping to within eof
  fs: invalidate page cache after end_io() in dio completion
  xfs: cancel dirty pages on invalidation

1  2 
fs/direct-io.c

diff --cc fs/direct-io.c
index 563254869e2fa4fa62bd91a58d9524a5180bc5ef,19ac3fe57debb633a2e2830e4c1f5fa235a8b980..b53e66d9abd7030f6b05a6dac4847928c24bf1a0
@@@ -271,9 -272,13 +278,14 @@@ static ssize_t dio_complete(struct dio 
         * of the write was an mmap'ed region of the file we're writing.  Either
         * one is a pretty crazy thing to do, so we don't support it 100%.  If
         * this invalidation fails, tough, the write still worked...
+        *
+        * And this page cache invalidation has to be after dio->end_io(), as
+        * some filesystems convert unwritten extents to real allocations in
+        * end_io() when necessary, otherwise a racing buffer read would cache
+        * zeros from unwritten extents.
         */
 -      if (ret > 0 && dio->op == REQ_OP_WRITE &&
 +      if (flags & DIO_COMPLETE_INVALIDATE &&
 +          ret > 0 && dio->op == REQ_OP_WRITE &&
            dio->inode->i_mapping->nrpages) {
                err = invalidate_inode_pages2_range(dio->inode->i_mapping,
                                        offset >> PAGE_SHIFT,