diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-20 20:10:02 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-20 20:10:02 +0300 |
commit | e599e16c16a16be9907fb00608212df56d08d57b (patch) | |
tree | 5f1dfb0dc7d3a8d03137a1a04e3f2873e43ac26d /fs | |
parent | 69435880cf138484c3012f6c38dcbc5605de39ee (diff) | |
parent | efa96cc99793bafe96bdbff6abab94d81472a32d (diff) | |
download | linux-e599e16c16a16be9907fb00608212df56d08d57b.tar.xz |
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
Diffstat (limited to 'fs')
-rw-r--r-- | fs/iomap/buffered-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index adb92cdb24b0..aa8967cca1a3 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -872,10 +872,10 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, while ((ret = iomap_iter(&iter, ops)) > 0) iter.processed = iomap_write_iter(&iter, i); - if (unlikely(ret < 0)) + if (unlikely(iter.pos == iocb->ki_pos)) return ret; ret = iter.pos - iocb->ki_pos; - iocb->ki_pos += ret; + iocb->ki_pos = iter.pos; return ret; } EXPORT_SYMBOL_GPL(iomap_file_buffered_write); |