summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2018-04-27 15:51:23 +0200
committerHeiko Schocher <hs@denx.de>2018-05-09 11:53:55 +0200
commit87deefeccc49756ee33b5c0fb6dbe331dfdff487 (patch)
tree1dcb86b11064e9738b977542f45b3f517784e09d /fs
parentcc95535867f407534b0e59f8b5017f0f729833a9 (diff)
downloadu-boot-87deefeccc49756ee33b5c0fb6dbe331dfdff487.tar.gz
ubifs: avoid assert failed in ubifs.c
This patch solves assert failed displayed in the console during a boot. The root cause is that the ubifs_inode is not already allocated when ubifs_printdir and ubifs_finddir functions are called. Trace showing the issue: feed 'boot.scr.uimg', ino 94, new f_pos 0x17b40ece dent->ch.sqnum '7132', creat_sqnum 3886945402880 UBIFS assert failed in ubifs_finddir at 436 INODE ALLOCATION: creat_sqnum '7129' Found U-Boot script /boot.scr.uimg Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/ubifs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 8249879d8a..47fa41ad1d 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -349,7 +349,9 @@ static int ubifs_printdir(struct file *file, void *dirent)
dbg_gen("feed '%s', ino %llu, new f_pos %#x",
dent->name, (unsigned long long)le64_to_cpu(dent->inum),
key_hash_flash(c, &dent->key));
+#ifndef __UBOOT__
ubifs_assert(le64_to_cpu(dent->ch.sqnum) > ubifs_inode(dir)->creat_sqnum);
+#endif
nm.len = le16_to_cpu(dent->nlen);
over = filldir(c, (char *)dent->name, nm.len,
@@ -431,7 +433,9 @@ static int ubifs_finddir(struct super_block *sb, char *dirname,
dbg_gen("feed '%s', ino %llu, new f_pos %#x",
dent->name, (unsigned long long)le64_to_cpu(dent->inum),
key_hash_flash(c, &dent->key));
+#ifndef __UBOOT__
ubifs_assert(le64_to_cpu(dent->ch.sqnum) > ubifs_inode(dir)->creat_sqnum);
+#endif
nm.len = le16_to_cpu(dent->nlen);
if ((strncmp(dirname, (char *)dent->name, nm.len) == 0) &&