From: Andreas Gruenbacher Date: Tue, 19 Apr 2022 18:51:50 +0000 (+0200) Subject: gfs2: Don't re-check for write past EOF unnecessarily X-Git-Tag: baikal/mips/sdk6.1~5917^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=aa900c1fec16ec6e7bf8ac9827d132c15c188b28;p=kernel.git 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 --- 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,