aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-04-19 20:51:50 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2022-04-26 15:38:00 +0200
commite57f9af73d6b0ffb5f1aeaf6cec9a751dd8535c9 (patch)
treebbf7d0f2abaad2fa0f99e4378c503429674c480e
parentaf2d861d4cd2a4da5137f795ee3509e6f944a25b (diff)
downloadbp-e57f9af73d6b0ffb5f1aeaf6cec9a751dd8535c9.tar.gz
gfs2: Don't re-check for write past EOF unnecessarily
Only re-check for direct I/O writes past the end of the file after re-acquiring the inode glock. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
-rw-r--r--fs/gfs2/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 22b41acfbbc39..8d889235afcde 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -899,10 +899,10 @@ retry:
ret = gfs2_glock_nq(gh);
if (ret)
goto out_uninit;
-retry_under_glock:
/* Silently fall back to buffered I/O when writing beyond EOF */
if (iocb->ki_pos + iov_iter_count(from) > i_size_read(&ip->i_inode))
goto out;
+retry_under_glock:
from->nofault = true;
ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL,