Commit e599e16c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'iomap-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull iomap fix from Darrick Wong:
 "Fix partial write regression.

  It turns out that fstests doesn't have any test coverage for short
  writes, but LTP does. Fortunately, this was caught right after -rc1
  was tagged.

  Summary:

   - Fix a bug wherein a failed write could clobber short write status"

* tag 'iomap-6.5-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write
  iomap: fix a regression for partial write errors
parents 69435880 efa96cc9
...@@ -872,10 +872,10 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, ...@@ -872,10 +872,10 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
while ((ret = iomap_iter(&iter, ops)) > 0) while ((ret = iomap_iter(&iter, ops)) > 0)
iter.processed = iomap_write_iter(&iter, i); iter.processed = iomap_write_iter(&iter, i);
if (unlikely(ret < 0)) if (unlikely(iter.pos == iocb->ki_pos))
return ret; return ret;
ret = iter.pos - iocb->ki_pos; ret = iter.pos - iocb->ki_pos;
iocb->ki_pos += ret; iocb->ki_pos = iter.pos;
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(iomap_file_buffered_write); EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
......
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