* [PATCH 0/2] erofs-utils: minor cleanups and enhancements
@ 2026-03-06 8:57 Nithurshen
2026-03-06 8:57 ` [PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-06 8:57 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
Hi,
This patch series introduces two minor improvements to the erofs-utils tools:
1. dump.erofs: Removes a redundant conditional branch in the filesize distribution output logic to clean up the code.
2. fsck.erofs: Adds a warning message when encountering an unsupported file type during extraction, rather than silently skipping it.
Thanks,
Nithurshen
Nithurshen (2):
erofs-utils: dump: remove redundant conditional branch in filesize
distribution
erofs-utils: fsck: add warning for unsupported file types during
extraction
dump/main.c | 3 ---
fsck/main.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
@ 2026-03-06 8:57 ` Nithurshen
2026-03-06 8:57 ` [PATCH 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-06 8:57 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
The logic for printing the filesize distribution chart in `dump.erofs` contained an `else if (i <= 6)` branch that executed the exact same sprintf statement as the fallback `else` branch.
Remove the redundant `else if` condition to clean up the code and simplify the logic.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
dump/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dump/main.c b/dump/main.c
index 567cff6..78c50d5 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -522,10 +522,7 @@ static void erofsdump_filesize_distribution(const char *title,
memset(col4, 0, sizeof(col4));
if (i == len - 1)
sprintf(col1, "%6d ..", lowerbound);
- else if (i <= 6)
- sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
else
-
sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
col2 = file_counts[i];
if (stats.file_category_stat[EROFS_FT_REG_FILE])
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
2026-03-06 8:57 ` [PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
@ 2026-03-06 8:57 ` Nithurshen
2026-03-16 10:05 ` [PATCH 0/2] erofs-utils: minor cleanups and enhancements Gao Xiang
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-06 8:57 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
When extracting an image using `fsck.erofs`, if the tool encounters an unsupported file type (falling into the `default` case of the switch statement), it currently skips extraction silently and jumps straight to verifying the data chunk layout.
Add a warning message to the `default` case so the user is explicitly informed that a specific file type was not extracted, rather than failing silently.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
fsck/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 16cc627..16a354f 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -963,7 +963,8 @@ verify:
ret = erofs_extract_special(inode);
break;
default:
- /* TODO */
+ erofs_warn("unsupported file type %o @ nid %llu, skipped extraction",
+ inode->i_mode, inode->nid | 0ULL);
goto verify;
}
if (ret && ret != -ECANCELED)
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] erofs-utils: minor cleanups and enhancements
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
2026-03-06 8:57 ` [PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-06 8:57 ` [PATCH 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
@ 2026-03-16 10:05 ` Gao Xiang
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
2026-03-16 10:59 ` [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
4 siblings, 0 replies; 12+ messages in thread
From: Gao Xiang @ 2026-03-16 10:05 UTC (permalink / raw)
To: Nithurshen, linux-erofs; +Cc: xiang
On 2026/3/6 16:57, Nithurshen wrote:
> Hi,
>
> This patch series introduces two minor improvements to the erofs-utils tools:
>
> 1. dump.erofs: Removes a redundant conditional branch in the filesize distribution output logic to clean up the code.
> 2. fsck.erofs: Adds a warning message when encountering an unsupported file type during extraction, rather than silently skipping it.
Those patches looks good, but each line in the commit messages
is too long.
They should be no more than 72-char instead.
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 0/2] erofs-utils: minor cleanups and enhancements
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
` (2 preceding siblings ...)
2026-03-16 10:05 ` [PATCH 0/2] erofs-utils: minor cleanups and enhancements Gao Xiang
@ 2026-03-16 10:52 ` Nithurshen
2026-03-16 10:52 ` [PATCH v2 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
` (3 more replies)
2026-03-16 10:59 ` [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
4 siblings, 4 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:52 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
Hi,
This patch series introduces two minor improvements to the erofs-utils
tools. The first patch simplifies redundant logic in dump.erofs,
and the second adds a warning for unsupported file types in fsck.erofs.
Changes since v1:
- Rewrapped commit messages to 72 characters per line to comply with
project standards, as requested by Gao Xiang.
Nithurshen (2):
erofs-utils: dump: remove redundant conditional branch in filesize
distribution
erofs-utils: fsck: add warning for unsupported file types during
extraction
dump/main.c | 3 ---
fsck/main.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
@ 2026-03-16 10:52 ` Nithurshen
2026-03-16 10:52 ` [PATCH v2] erofs-utils: mkfs: add --exclude-path-from and --exclude-regex-from Nithurshen
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:52 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
The logic for printing the filesize distribution chart in dump.erofs
contained an else if (i <= 6) branch that executed the exact same
sprintf statement as the fallback else branch.
Remove the redundant else if condition to clean up the code and
simplify the logic.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
dump/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dump/main.c b/dump/main.c
index 567cff6..78c50d5 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -522,10 +522,7 @@ static void erofsdump_filesize_distribution(const char *title,
memset(col4, 0, sizeof(col4));
if (i == len - 1)
sprintf(col1, "%6d ..", lowerbound);
- else if (i <= 6)
- sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
else
-
sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
col2 = file_counts[i];
if (stats.file_category_stat[EROFS_FT_REG_FILE])
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2] erofs-utils: mkfs: add --exclude-path-from and --exclude-regex-from
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
2026-03-16 10:52 ` [PATCH v2 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
@ 2026-03-16 10:52 ` Nithurshen
2026-03-16 10:52 ` [PATCH v2] mkfs: support block map for blob devices Nithurshen
2026-03-16 10:52 ` [PATCH v2 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
3 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:52 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
Currently, users who want to exclude multiple specific files or paths
must pass them one-by-one using --exclude-path or --exclude-regex via
the command line. This becomes cumbersome for complex build systems
with dozens of exclusions.
This patch introduces --exclude-path-from=FILE and
--exclude-regex-from=FILE flags to mkfs.erofs. Similar to standard
archiving tools, they allow users to supply a text file containing a
list of literal paths or regular expressions to exclude, which are
read line-by-line and applied to the EROFS build process.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
mkfs/main.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/mkfs/main.c b/mkfs/main.c
index 07ef086..1240771 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -39,6 +39,8 @@ static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
{"exclude-path", required_argument, NULL, 2},
{"exclude-regex", required_argument, NULL, 3},
+ {"exclude-path-from", required_argument, NULL, 540},
+ {"exclude-regex-from", required_argument, NULL, 541},
#ifdef HAVE_LIBSELINUX
{"file-contexts", required_argument, NULL, 4},
#endif
@@ -199,6 +201,8 @@ static void usage(int argc, char **argv)
" --dsunit=# align all data block addresses to multiples of #\n"
" --exclude-path=X avoid including file X (X = exact literal path)\n"
" --exclude-regex=X avoid including files that match X (X = regular expression)\n"
+ " --exclude-path-from=X avoid including files listed in file X\n"
+ " --exclude-regex-from=X avoid including regexes listed in file X\n"
#ifdef HAVE_LIBSELINUX
" --file-contexts=X specify a file contexts file to setup selinux labels\n"
#endif
@@ -1246,6 +1250,41 @@ static int mkfs_parse_options_cfg(struct erofs_importer_params *params,
case 7:
params->fixed_uid = params->fixed_gid = 0;
break;
+ case 540:
+ case 541: {
+ FILE *f = fopen(optarg, "r");
+ if (!f) {
+ erofs_err("failed to open exclude file: %s", optarg);
+ return -errno;
+ }
+
+ char *line = NULL;
+ size_t len = 0;
+ ssize_t read;
+ bool is_regex = (opt == 541);
+
+ while ((read = getline(&line, &len, f)) != -1) {
+ if (read > 0 && line[read - 1] == '\n') {
+ line[read - 1] = '\0';
+ read--;
+ }
+
+ if (read == 0) continue;
+
+ err = erofs_parse_exclude_path(line, is_regex);
+ if (err) {
+ erofs_err("failed to parse exclude rule from file: %s",
+ erofs_strerror(err));
+ free(line);
+ fclose(f);
+ return err;
+ }
+ }
+ free(line);
+ fclose(f);
+ break;
+ }
+
#ifndef NDEBUG
case 8:
cfg.c_random_pclusterblks = true;
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2] mkfs: support block map for blob devices
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
2026-03-16 10:52 ` [PATCH v2 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-16 10:52 ` [PATCH v2] erofs-utils: mkfs: add --exclude-path-from and --exclude-regex-from Nithurshen
@ 2026-03-16 10:52 ` Nithurshen
2026-03-16 10:52 ` [PATCH v2 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
3 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:52 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
Currently, using --blobdev to specify an extra device is restricted
from working with the block map chunk format. This was previously
noted as a task that could be implemented by mapping the device
blocks using a global address.
This patch implements this support by allowing the block map to
reference chunks residing on extra devices. This is achieved by:
1) Removing the -EINVAL check in mkfs/main.c.
2) Calculating the global startblk address for the block map by
summing the blocks of the primary device and preceding devices.
3) Ensuring EROFS_CHUNK_FORMAT_INDEXES is only set if the user
has not forced the block map format.
4) Updating erofs_inode_fixup_chunkformat to error out if the
mapped address exceeds UINT32_MAX, as block maps cannot
support 48-bit addressing.
In addition, erofs_map_dev() is updated to correctly identify the
device ID when a global block address is used with block maps,
enabling userspace tools to read these images.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
lib/blobchunk.c | 34 ++++++++++++++++++++++++++++------
lib/data.c | 1 +
mkfs/main.c | 7 -------
3 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 96c161b..fdcf4b3 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -159,7 +159,17 @@ void erofs_inode_fixup_chunkformat(struct erofs_inode *inode)
if (chunk->blkaddr == EROFS_NULL_ADDR)
continue;
if (chunk->device_id) {
- if (chunk->blkaddr > UINT32_MAX) {
+ if (!(inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES)) {
+ erofs_blk_t mapped_blkaddr = inode->sbi->primarydevice_blocks;
+ unsigned int i;
+
+ for (i = 0; i < chunk->device_id - 1; i++)
+ mapped_blkaddr += inode->sbi->devs[i].blocks;
+ if (mapped_blkaddr + chunk->blkaddr > UINT32_MAX) {
+ erofs_err("block map cannot support addresses > UINT32_MAX");
+ return;
+ }
+ } else if (chunk->blkaddr > UINT32_MAX) {
_48bit = true;
break;
}
@@ -201,8 +211,16 @@ int erofs_write_chunk_indexes(struct erofs_inode *inode, struct erofs_vfile *vf,
if (chunk->blkaddr == EROFS_NULL_ADDR) {
startblk = EROFS_NULL_ADDR;
} else if (chunk->device_id) {
- DBG_BUGON(!(inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES));
- startblk = chunk->blkaddr;
+ if (inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES) {
+ startblk = chunk->blkaddr;
+ } else {
+ unsigned int i;
+
+ startblk = sbi->primarydevice_blocks;
+ for (i = 0; i < chunk->device_id - 1; i++)
+ startblk += sbi->devs[i].blocks;
+ startblk += chunk->blkaddr;
+ }
extent_start = EROFS_NULL_ADDR;
} else {
startblk = remapped_base + chunk->blkaddr;
@@ -324,7 +342,7 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode, int fd,
chunksize = 1ULL << chunkbits;
count = DIV_ROUND_UP(inode->i_size, chunksize);
- if (sbi->extra_devices)
+ if (sbi->extra_devices && cfg.c_force_chunkformat != FORCE_INODE_BLOCK_MAP)
inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
if (inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
unit = sizeof(struct erofs_inode_chunk_index);
@@ -494,8 +512,12 @@ int tarerofs_write_chunkes(struct erofs_inode *inode, erofs_off_t data_offset)
inode->u.chunkformat |= chunkbits - sbi->blkszbits;
if (sbi->extra_devices) {
device_id = 1;
- inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
- unit = sizeof(struct erofs_inode_chunk_index);
+ if (cfg.c_force_chunkformat != FORCE_INODE_BLOCK_MAP)
+ inode->u.chunkformat |= EROFS_CHUNK_FORMAT_INDEXES;
+ if (inode->u.chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
+ unit = sizeof(struct erofs_inode_chunk_index);
+ else
+ unit = EROFS_BLOCK_MAP_ENTRY_SIZE;
DBG_BUGON(erofs_blkoff(sbi, data_offset));
blkaddr = erofs_blknr(sbi, data_offset);
} else {
diff --git a/lib/data.c b/lib/data.c
index 6fd1389..5aeb0c1 100644
--- a/lib/data.c
+++ b/lib/data.c
@@ -184,6 +184,7 @@ int erofs_map_dev(struct erofs_sb_info *sbi, struct erofs_map_dev *map)
if (map->m_pa >= startoff &&
map->m_pa < startoff + length) {
map->m_pa -= startoff;
+ map->m_deviceid = id + 1;
break;
}
}
diff --git a/mkfs/main.c b/mkfs/main.c
index 58c18f9..07ef086 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1565,13 +1565,6 @@ static int mkfs_parse_options_cfg(struct erofs_importer_params *params,
return -EINVAL;
}
- /* TODO: can be implemented with (deviceslot) mapped_blkaddr */
- if (cfg.c_blobdev_path &&
- cfg.c_force_chunkformat == FORCE_INODE_BLOCK_MAP) {
- erofs_err("--blobdev cannot work with block map currently");
- return -EINVAL;
- }
-
if (optind >= argc) {
erofs_err("missing argument: FILE");
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
` (2 preceding siblings ...)
2026-03-16 10:52 ` [PATCH v2] mkfs: support block map for blob devices Nithurshen
@ 2026-03-16 10:52 ` Nithurshen
3 siblings, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:52 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
When extracting an image using fsck.erofs, if the tool encounters
an unsupported file type (falling into the default case of the
switch statement), it currently skips extraction silently and jumps
straight to verifying the data chunk layout.
Add a warning message to the default case so the user is explicitly
informed that a specific file type was not extracted, rather than
failing silently.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
fsck/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 16cc627..16a354f 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -963,7 +963,8 @@ verify:
ret = erofs_extract_special(inode);
break;
default:
- /* TODO */
+ erofs_warn("unsupported file type %o @ nid %llu, skipped extraction",
+ inode->i_mode, inode->nid | 0ULL);
goto verify;
}
if (ret && ret != -ECANCELED)
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
` (3 preceding siblings ...)
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
@ 2026-03-16 10:59 ` Nithurshen
2026-03-16 10:59 ` [PATCH v3 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-16 10:59 ` [PATCH v3 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
4 siblings, 2 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:59 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
Hi,
This series fixes a redundant logic branch in dump.erofs and adds
a warning for unsupported file types in fsck.erofs.
Changes since v2:
- Removed unrelated patches that were accidentally included in the
v2 submission.
- No changes to the logic of the two patches in this series.
Changes since v1:
- Rewrapped commit messages to 72 characters per line.
Nithurshen (2):
erofs-utils: dump: remove redundant conditional branch in filesize
distribution
erofs-utils: fsck: add warning for unsupported file types during
extraction
dump/main.c | 3 ---
fsck/main.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution
2026-03-16 10:59 ` [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
@ 2026-03-16 10:59 ` Nithurshen
2026-03-16 10:59 ` [PATCH v3 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
1 sibling, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:59 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
The logic for printing the filesize distribution chart in dump.erofs
contained an else if (i <= 6) branch that executed the exact same
sprintf statement as the fallback else branch.
Remove the redundant else if condition to clean up the code and
simplify the logic.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
dump/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dump/main.c b/dump/main.c
index 567cff6..78c50d5 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -522,10 +522,7 @@ static void erofsdump_filesize_distribution(const char *title,
memset(col4, 0, sizeof(col4));
if (i == len - 1)
sprintf(col1, "%6d ..", lowerbound);
- else if (i <= 6)
- sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
else
-
sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
col2 = file_counts[i];
if (stats.file_category_stat[EROFS_FT_REG_FILE])
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction
2026-03-16 10:59 ` [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
2026-03-16 10:59 ` [PATCH v3 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
@ 2026-03-16 10:59 ` Nithurshen
1 sibling, 0 replies; 12+ messages in thread
From: Nithurshen @ 2026-03-16 10:59 UTC (permalink / raw)
To: linux-erofs; +Cc: xiang, hsiangkao, Nithurshen
When extracting an image using fsck.erofs, if the tool encounters
an unsupported file type (falling into the default case of the
switch statement), it currently skips extraction silently and jumps
straight to verifying the data chunk layout.
Add a warning message to the default case so the user is explicitly
informed that a specific file type was not extracted, rather than
failing silently.
Signed-off-by: Nithurshen <nithurshen.dev@gmail.com>
---
fsck/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 16cc627..16a354f 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -963,7 +963,8 @@ verify:
ret = erofs_extract_special(inode);
break;
default:
- /* TODO */
+ erofs_warn("unsupported file type %o @ nid %llu, skipped extraction",
+ inode->i_mode, inode->nid | 0ULL);
goto verify;
}
if (ret && ret != -ECANCELED)
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-03-16 10:59 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 8:57 [PATCH 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
2026-03-06 8:57 ` [PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-06 8:57 ` [PATCH 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
2026-03-16 10:05 ` [PATCH 0/2] erofs-utils: minor cleanups and enhancements Gao Xiang
2026-03-16 10:52 ` [PATCH v2 " Nithurshen
2026-03-16 10:52 ` [PATCH v2 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-16 10:52 ` [PATCH v2] erofs-utils: mkfs: add --exclude-path-from and --exclude-regex-from Nithurshen
2026-03-16 10:52 ` [PATCH v2] mkfs: support block map for blob devices Nithurshen
2026-03-16 10:52 ` [PATCH v2 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
2026-03-16 10:59 ` [PATCH v3 0/2] erofs-utils: minor cleanups and enhancements Nithurshen
2026-03-16 10:59 ` [PATCH v3 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution Nithurshen
2026-03-16 10:59 ` [PATCH v3 2/2] erofs-utils: fsck: add warning for unsupported file types during extraction Nithurshen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox