Skip to contentSkip to conversation

erofs-utils: fix chunk-based image handling without real data

PATCH New Gao Xiang 1 participant 1 message Jan 31, 2023 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: fix chunk-based image handling without real data

Otherwise it will report:
<I> erofs: total metadata: 982 blocks
<E> erofs: Could not format the device : [Error 5] Input/output error

Fixes 03cbf7b8f7f7 ("erofs-utils: mkfs: support chunk-based uncompressed files")
---
 lib/blobchunk.c | 2 ++
 1 file changed, 2 insertions(+)
lib/blobchunk.c +2 -0
index 744d054..55e3f85 100644
@@ -276,6 +276,8 @@ int erofs_blob_remap(void)
 		erofs_bdrop(bh_devt, false);
 		return 0;
 	}
+	if (!length)	/* bail out if there is no chunked data */
+		return 0;
 	bh = erofs_balloc(DATA, length, 0, 0);
 	if (IS_ERR(bh))
 		return PTR_ERR(bh);
Signature · 1 line
2.24.4