Skip to content

Commit e599e16

Browse files
committed
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
2 parents 6943588 + efa96cc commit e599e16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/iomap/buffered-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,10 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
872872
while ((ret = iomap_iter(&iter, ops)) > 0)
873873
iter.processed = iomap_write_iter(&iter, i);
874874

875-
if (unlikely(ret < 0))
875+
if (unlikely(iter.pos == iocb->ki_pos))
876876
return ret;
877877
ret = iter.pos - iocb->ki_pos;
878-
iocb->ki_pos += ret;
878+
iocb->ki_pos = iter.pos;
879879
return ret;
880880
}
881881
EXPORT_SYMBOL_GPL(iomap_file_buffered_write);

0 commit comments

Comments
 (0)