From 408c2cc48e6694446c89da7f8121b399063e1067 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 14 Jul 2024 19:21:09 +0100 Subject: [PATCH] libfstools: skip JFFS2 padding when BLOCKSIZE was given When BLOCKSIZE is defined we call padjffs2 with the defined alignment to pad towards. That results in one of more block of all-1s instead of the expected 0xdeadc0de and ultimaltely breaks restoring configuration as fstools won't look for a the GZ signature indicating the config backup in this case. Change that and also look for config backup when all-1s are used for padding. Fixes: ee54c6b ("libfstools: skip JFFS2 padding on block devices") Signed-off-by: Daniel Golle --- libfstools/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libfstools/common.c b/libfstools/common.c index 6c513f0..82362f7 100644 --- a/libfstools/common.c +++ b/libfstools/common.c @@ -122,6 +122,7 @@ int block_volume_format(struct volume *v, uint64_t offset, const char *bdev) switch (volume_identify(v)) { case FS_DEADCODE: + case FS_NONE: /* skip padding */ fd = open(v->blk, O_RDONLY); if (fd < 0) { @@ -159,8 +160,6 @@ int block_volume_format(struct volume *v, uint64_t offset, const char *bdev) ULOG_ERR("failed extracting config backup from %s\n", v->blk); break; } - /* fall-through */ - case FS_NONE: do_format: ULOG_INFO("overlay filesystem in %s has not been formatted yet\n", v->blk); if (use_f2fs(v, offset, bdev)) -- 2.30.2