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>
This commit is contained in:
Andreas Gruenbacher 2022-05-05 18:19:13 -07:00 committed by Darrick J. Wong
parent b71450e2cc
commit d74999c8c0

View File

@ -734,7 +734,7 @@ static size_t iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len,
folio_put(folio);
if (ret < len)
iomap_write_failed(iter->inode, pos, len);
iomap_write_failed(iter->inode, pos + ret, len - ret);
return ret;
}