All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iomap: iomap_write_end cleanup
@ 2022-05-03 21:37 Andreas Gruenbacher
  2022-05-03 21:52 ` Matthew Wilcox
  2022-05-04 14:13 ` Christoph Hellwig
  0 siblings, 2 replies; 9+ messages in thread
From: Andreas Gruenbacher @ 2022-05-03 21:37 UTC (permalink / raw)
  To: Christoph Hellwig, Darrick J . Wong
  Cc: Linus Torvalds, linux-xfs, linux-fsdevel, Andreas Gruenbacher

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>
---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-04 18:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 21:37 [PATCH] iomap: iomap_write_end cleanup Andreas Gruenbacher
2022-05-03 21:52 ` Matthew Wilcox
2022-05-03 22:15   ` Andreas Gruenbacher
2022-05-03 23:02     ` Darrick J. Wong
2022-05-04  0:27       ` Matthew Wilcox
2022-05-04 14:22         ` Christoph Hellwig
2022-05-04 17:21           ` Andreas Gruenbacher
2022-05-04  8:02       ` Andreas Gruenbacher
2022-05-04 14:13 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.