summaryrefslogtreecommitdiffstats
path: root/fs/iomap/buffered-io.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2020-09-10 17:26:16 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2020-09-10 17:26:16 +0200
commitc114bbc6c423a449a00780d2d6633432c0a0505f (patch)
tree45410f7b3d7fe4e360785639699d6e2afdad1387 /fs/iomap/buffered-io.c
parentiomap: fix WARN_ON_ONCE() from unprivileged users (diff)
downloadlinux-c114bbc6c423a449a00780d2d6633432c0a0505f.tar.xz
linux-c114bbc6c423a449a00780d2d6633432c0a0505f.zip
iomap: Fix direct I/O write consistency check
When a direct I/O write falls back to buffered I/O entirely, dio->size will be 0 in iomap_dio_complete. Function invalidate_inode_pages2_range will try to invalidate the rest of the address space. If there are any dirty pages in that range, the write will fail and a "Page cache invalidation failure on direct I/O" error will be logged. On gfs2, this can be reproduced as follows: xfs_io \ -c "open -ft foo" -c "pwrite 4k 4k" -c "close" \ -c "open -d foo" -c "pwrite 0 4k" Fix this by recognizing 0-length writes. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/iomap/buffered-io.c')
0 files changed, 0 insertions, 0 deletions