[openwrt/openwrt] kernel: mtdsplit_h3c_vfs: use -ENOENT instead of -ENODEV
LEDE Commits
lede-commits at lists.infradead.org
Thu Nov 20 14:42:27 PST 2025
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2acf18bf4deb7d431e4ef3858ae8969a481fe196
commit 2acf18bf4deb7d431e4ef3858ae8969a481fe196
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Nov 20 23:24:01 2025 +0100
kernel: mtdsplit_h3c_vfs: use -ENOENT instead of -ENODEV
New linux version will check the return code of parser on subpartitions.
The only valid case for skipping a parser with an error is -ENOENT.
Change the relevant entry to -ENOENT.
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
.../generic/files/drivers/mtd/mtdsplit/mtdsplit_h3c_vfs.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_h3c_vfs.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_h3c_vfs.c
index f264233dbd..a766ff7c2f 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_h3c_vfs.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_h3c_vfs.c
@@ -99,7 +99,9 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
return -EIO;
if (format_flag != FORMAT_FLAG)
- return -EINVAL;
+ pr_debug("mtdsplit_h3c_vfs: unexpected format flag %08x\n",
+ format_flag);
+ return -ENOENT;
/* Check file entry */
err = mtd_read(mtd, FILE_ENTRY_OFFSET, sizeof(file_entry), &retlen,
@@ -111,19 +113,19 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
return -EIO;
if (file_entry.flags != FILE_ENTRY_FLAGS)
- return -EINVAL;
+ return -ENOENT;
if (file_entry.parent_block != FILE_ENTRY_PARENT_BLOCK)
- return -EINVAL;
+ return -ENOENT;
if (file_entry.parent_index != FILE_ENTRY_PARENT_INDEX)
- return -EINVAL;
+ return -ENOENT;
if (file_entry.data_block != FILE_ENTRY_DATA_BLOCK)
- return -EINVAL;
+ return -ENOENT;
if (strncmp(file_entry.name, FILE_ENTRY_NAME, sizeof(file_entry.name)) != 0)
- return -EINVAL;
+ return -ENOENT;
/* Find rootfs offset */
kernel_size = block_offset(file_entry.data_block +
More information about the lede-commits
mailing list