Skip to content

Commit e57f9af

Browse files
author
Andreas Gruenbacher
committed
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 <[email protected]>
1 parent af2d861 commit e57f9af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/gfs2/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,10 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from,
899899
ret = gfs2_glock_nq(gh);
900900
if (ret)
901901
goto out_uninit;
902-
retry_under_glock:
903902
/* Silently fall back to buffered I/O when writing beyond EOF */
904903
if (iocb->ki_pos + iov_iter_count(from) > i_size_read(&ip->i_inode))
905904
goto out;
905+
retry_under_glock:
906906

907907
from->nofault = true;
908908
ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL,

0 commit comments

Comments
 (0)