Skip to content

Commit d74999c

Browse files
Andreas GruenbacherDarrick J. Wong
authored andcommitted
iomap: iomap_write_end cleanup
In iomap_write_end(), only call iomap_write_failed() on the byte range that has failed. This should improve code readability, but doesn't fix an actual bug because iomap_write_failed() is called after updating the file size here and it only affects the memory beyond the end of the file. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
1 parent b71450e commit d74999c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ static size_t iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len,
734734
folio_put(folio);
735735

736736
if (ret < len)
737-
iomap_write_failed(iter->inode, pos, len);
737+
iomap_write_failed(iter->inode, pos + ret, len - ret);
738738
return ret;
739739
}
740740

0 commit comments

Comments
 (0)