Skip to contentSkip to conversation

erofs-utils: mkfs: fix a regression where rebuild mode does not work

PATCH New Gao Xiang 1 participant 1 message Sep 19, 2024

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: mkfs: fix a regression where rebuild mode does not work

It will fail unexpectedly if any sub-image lacks an extra device (blob).

Fixes 7550a30c332c ("erofs-utils: enable incremental builds")
---
 mkfs/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mkfs/main.c +2 -1
index 5c8b5e4..7e2e184 100644
@@ -1091,7 +1091,8 @@ static int erofs_mkfs_rebuild_load_trees(struct erofs_inode *root)
 	if (datamode != EROFS_REBUILD_DATA_BLOB_INDEX)
 		return 0;
 
-	if (extra_devices != rebuild_src_count) {
+	/* Each blob has either no extra device or only one device for TarFS */
+	if (extra_devices && extra_devices != rebuild_src_count) {
 		erofs_err("extra_devices(%u) is mismatched with source images(%u)",
 			  extra_devices, rebuild_src_count);
 		return -EOPNOTSUPP;
Signature · 1 line
2.43.5