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")
Signed-off-by: Gao Xiang <[email protected]>
---
 lib/blobchunk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 744d054..55e3f85 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -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);
-- 
2.24.4

Reply via email to