mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 06:24:17 +00:00
ubifs: mount fails after power cycle
When kernel uses file system encryption, fscrypt on UBIFS v5, after a hard power cycle UBIFS journal replay fails which results in mount failure. Failure logs: UBIFS: recovery needed UBIFS error (pid 0): ubifs_validate_entry: bad directory entry node UBIFS error (pid 0): replay_bud: bad node is at LEB 890:24576 UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi0:rootfs' errno=-22! This change is ported from kernel: commit id: 304790c038bc4af4f19774705409db27eafb09fc Kernel commit description: Kernel commit description: ubifs: Relax checks in ubifs_validate_entry() With encrypted filenames we store raw binary data, doing string tests is no longer possible. Signed-off-by: rminnikanti <rminnikanti@marvell.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
ca1f11d8c1
commit
cf7ea719ce
1 changed files with 1 additions and 1 deletions
|
@ -451,7 +451,7 @@ int ubifs_validate_entry(struct ubifs_info *c,
|
||||||
if (le32_to_cpu(dent->ch.len) != nlen + UBIFS_DENT_NODE_SZ + 1 ||
|
if (le32_to_cpu(dent->ch.len) != nlen + UBIFS_DENT_NODE_SZ + 1 ||
|
||||||
dent->type >= UBIFS_ITYPES_CNT ||
|
dent->type >= UBIFS_ITYPES_CNT ||
|
||||||
nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 ||
|
nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 ||
|
||||||
strnlen(dent->name, nlen) != nlen ||
|
(key_type == UBIFS_XENT_KEY && strnlen(dent->name, nlen) != nlen) ||
|
||||||
le64_to_cpu(dent->inum) > MAX_INUM) {
|
le64_to_cpu(dent->inum) > MAX_INUM) {
|
||||||
ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ?
|
ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ?
|
||||||
"directory entry" : "extended attribute entry");
|
"directory entry" : "extended attribute entry");
|
||||||
|
|
Loading…
Add table
Reference in a new issue