summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-23 22:45:59 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-08-05 09:24:16 -0700
commit60263d5889e6dc5987dc51b801be4955ff2e4aa7 (patch)
treecb8418c747e19055b1416e993c3b00578046f520 /fs/gfs2
parent80e543ae24db8f03241004136cb5bb37586fba70 (diff)
downloadlinux-60263d5889e6dc5987dc51b801be4955ff2e4aa7.tar.gz
iomap: fall back to buffered writes for invalidation failures
Failing to invalid the page cache means data in incoherent, which is a very bad state for the system. Always fall back to buffered I/O through the page cache if we can't invalidate mappings. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Acked-by: Bob Peterson <rpeterso@redhat.com> Acked-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> # for ext4 Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> # for gfs2 Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index fe305e4bfd37..b8929e470b9f 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -814,7 +814,8 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL,
is_sync_kiocb(iocb));
-
+ if (ret == -ENOTBLK)
+ ret = 0;
out:
gfs2_glock_dq(&gh);
out_uninit: