summaryrefslogtreecommitdiffstats
path: root/fs/iomap
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-05-06 03:19:13 +0200
committerDarrick J. Wong <djwong@kernel.org>2022-05-08 23:47:42 +0200
commitd74999c8c060dfeaf9977b91baa3c795fc183a84 (patch)
treee3d1ecd4ffe97b036020d41f16277c44ff839f49 /fs/iomap
parentiomap: iomap_write_failed fix (diff)
downloadlinux-d74999c8c060dfeaf9977b91baa3c795fc183a84.tar.xz
linux-d74999c8c060dfeaf9977b91baa3c795fc183a84.zip
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>
Diffstat (limited to 'fs/iomap')
-rw-r--r--fs/iomap/buffered-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 358ee1fb6f0d..8fb9b2797fc5 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -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;
}