mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-10 14:42:11 -05:00
Revert "kernel: mtdsplit_h3c_vfs: return 0 for non-fatal errors"
This reverts commit 6fa1775348.
Skipping parser for subpartition will be handled now with -ENOENT.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
e9ae6b19f0
commit
728ca2bc39
@ -98,11 +98,8 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
|
||||
if (retlen != sizeof(format_flag))
|
||||
return -EIO;
|
||||
|
||||
if (format_flag != FORMAT_FLAG) {
|
||||
pr_info("mtdsplit_h3c_vfs: unexpected format flag %08x\n",
|
||||
format_flag);
|
||||
return 0;
|
||||
}
|
||||
if (format_flag != FORMAT_FLAG)
|
||||
return -EINVAL;
|
||||
|
||||
/* Check file entry */
|
||||
err = mtd_read(mtd, FILE_ENTRY_OFFSET, sizeof(file_entry), &retlen,
|
||||
@ -113,14 +110,20 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
|
||||
if (retlen != sizeof(file_entry))
|
||||
return -EIO;
|
||||
|
||||
if (file_entry.flags != FILE_ENTRY_FLAGS ||
|
||||
file_entry.parent_block != FILE_ENTRY_PARENT_BLOCK ||
|
||||
file_entry.parent_index != FILE_ENTRY_PARENT_INDEX ||
|
||||
file_entry.data_block != FILE_ENTRY_DATA_BLOCK ||
|
||||
strncmp(file_entry.name, FILE_ENTRY_NAME, sizeof(file_entry.name)) != 0) {
|
||||
pr_info("mtdsplit_h3c_vfs: unexpected file entry - OpenWrt probably not installed\n");
|
||||
return 0;
|
||||
}
|
||||
if (file_entry.flags != FILE_ENTRY_FLAGS)
|
||||
return -EINVAL;
|
||||
|
||||
if (file_entry.parent_block != FILE_ENTRY_PARENT_BLOCK)
|
||||
return -EINVAL;
|
||||
|
||||
if (file_entry.parent_index != FILE_ENTRY_PARENT_INDEX)
|
||||
return -EINVAL;
|
||||
|
||||
if (file_entry.data_block != FILE_ENTRY_DATA_BLOCK)
|
||||
return -EINVAL;
|
||||
|
||||
if (strncmp(file_entry.name, FILE_ENTRY_NAME, sizeof(file_entry.name)) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* Find rootfs offset */
|
||||
kernel_size = block_offset(file_entry.data_block +
|
||||
|
||||
Loading…
Reference in New Issue
Block a user