All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] erofs-utils: lib: fix short write retries
@ 2026-09-21 13:35 Yifan Zhao
  2026-09-21 13:35 ` [PATCH v2 2/4] erofs-utils: lib: fix large chunk index writes Yifan Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yifan Zhao @ 2026-09-21 13:35 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang

Retry with only the remaining byte count in both the pwrite() and
pwrite64() paths.

Assisted-by: Codex:gpt-6-astra
Signed-off-by: Yifan Zhao <stopire@gmail.com>
---
 lib/io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/io.c b/lib/io.c
index 5c5449f..f62129f 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -75,9 +75,9 @@ ssize_t erofs_io_pwrite(struct erofs_vfile *vf, const void *buf,
 	pos += vf->offset;
 	do {
 #ifdef HAVE_PWRITE64
-		ret = pwrite64(vf->fd, buf, len, (off64_t)pos);
+		ret = pwrite64(vf->fd, buf, len - written, (off64_t)pos);
 #else
-		ret = pwrite(vf->fd, buf, len, (off_t)pos);
+		ret = pwrite(vf->fd, buf, len - written, (off_t)pos);
 #endif
 		if (ret <= 0) {
 			if (!ret)
-- 
2.55.0



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

end of thread, other threads:[~2026-09-21 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 13:35 [PATCH v2 1/4] erofs-utils: lib: fix short write retries Yifan Zhao
2026-09-21 13:35 ` [PATCH v2 2/4] erofs-utils: lib: fix large chunk index writes Yifan Zhao
2026-09-21 13:35 ` [PATCH v2 3/4] erofs-utils: mkfs: add file-delta framework Yifan Zhao
2026-09-21 13:35 ` [PATCH v2 4/4] erofs-utils: mkfs: support dm-persistent file deltas Yifan Zhao

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.