[PATCH] erofs-utils: lib: relax erofs_write_device_table() device table check

Jonathan Calmels jcalmels at nvidia.com
Thu Feb 12 11:13:35 AEDT 2026


Avoid returning an error in erofs_write_device_table()
if a new device slot table hasn't been allocated.
Rationale is to allow erofs_importer_flush_all() to succeed when
dealing with images with pre-existing device slots.

Signed-off-by: Jonathan Calmels <jcalmels at nvidia.com>
---
 lib/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/super.c b/lib/super.c
index a203f96..d38396f 100644
--- a/lib/super.c
+++ b/lib/super.c
@@ -392,7 +392,7 @@ int erofs_write_device_table(struct erofs_sb_info *sbi)
 	if (!sbi->extra_devices)
 		goto out;
 	if (!bh)
-		return -EINVAL;
+		goto out;
 
 	pos = erofs_btell(bh, false);
 	if (pos == EROFS_NULL_ADDR) {
-- 
2.53.0



More information about the Linux-erofs mailing list