Commit 4fad37d5 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gfs2-v5.18-rc4-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2

Pull gfs2 fix from Andreas Gruenbacher:

 - Only re-check for direct I/O writes past the end of the file after
   re-acquiring the inode glock.

* tag 'gfs2-v5.18-rc4-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Don't re-check for write past EOF unnecessarily
parents fd574a2f e57f9af7
...@@ -899,10 +899,10 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from, ...@@ -899,10 +899,10 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from,
ret = gfs2_glock_nq(gh); ret = gfs2_glock_nq(gh);
if (ret) if (ret)
goto out_uninit; goto out_uninit;
retry_under_glock:
/* Silently fall back to buffered I/O when writing beyond EOF */ /* 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)) if (iocb->ki_pos + iov_iter_count(from) > i_size_read(&ip->i_inode))
goto out; goto out;
retry_under_glock:
from->nofault = true; from->nofault = true;
ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL, ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment