summaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorEryu Guan <eguan@redhat.com>2017-10-13 18:47:46 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2017-10-16 21:11:56 +0200
commit5e25c269e17de4c5a23ce886cda612b01365a944 (patch)
treeb89ee04551f1160174b58954002a268c3647b927 /fs/squashfs
parentxfs: cancel dirty pages on invalidation (diff)
downloadlinux-5e25c269e17de4c5a23ce886cda612b01365a944.tar.xz
linux-5e25c269e17de4c5a23ce886cda612b01365a944.zip
fs: invalidate page cache after end_io() in dio completion
Commit 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO") moved page cache invalidation from iomap_dio_rw() to iomap_dio_complete() for iomap based direct write path, but before the dio->end_io() call, and it re-introdued the bug fixed by commit c771c14baa33 ("iomap: invalidate page caches should be after iomap_dio_complete() in direct write"). I found this because fstests generic/418 started failing on XFS with v4.14-rc3 kernel, which is the regression test for this specific bug. So similarly, fix it by moving dio->end_io() (which does the unwritten extent conversion) before page cache invalidation, to make sure next buffer read reads the final real allocations not unwritten extents. I also add some comments about why should end_io() go first in case we get it wrong again in the future. Note that, there's no such problem in the non-iomap based direct write path, because we didn't remove the page cache invalidation after the ->direct_IO() in generic_file_direct_write() call, but I decided to fix dio_complete() too so we don't leave a landmine there, also be consistent with iomap_dio_complete(). Fixes: 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO") Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Diffstat (limited to 'fs/squashfs')
0 files changed, 0 insertions, 0 deletions