public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] ubifs: avoid assert failed in ubifs.c
Date: Tue, 22 May 2018 12:56:48 +0200	[thread overview]
Message-ID: <c4d2420c-a89a-a2d7-2e96-cdce3f06d4c8@gmail.com> (raw)
In-Reply-To: <2e8b68a0-931e-443a-9312-f921042cec23@gmail.com>

On 05/10/2018 10:57 PM, Marek Vasut wrote:
> On 04/27/2018 03:51 PM, Patrice Chotard wrote:
>> 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>
> 
> I ran into this too, but what I do not quite understand from the commit
> message is how hiding the error actually solves the problem that the
> assert points to.
> 
> Why does the assert trigger in the first place ?
> 
> What is the root cause of the issue that is being hidden by this patch?

Bump?

>> ---
>>
>>  fs/ubifs/ubifs.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
>> index 4465523d5fbe..a71c9400ef33 100644
>> --- a/fs/ubifs/ubifs.c
>> +++ b/fs/ubifs/ubifs.c
>> @@ -350,7 +350,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,
>> @@ -432,7 +434,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) &&
>>
> 
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-05-22 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 13:51 [U-Boot] [PATCH v1] ubifs: avoid assert failed in ubifs.c Patrice Chotard
2018-05-10  7:11 ` Heiko Schocher
2018-05-10 20:57 ` Marek Vasut
2018-05-22 10:56   ` Marek Vasut [this message]
2018-05-22 11:23     ` Richard Weinberger
2018-05-22 12:42       ` Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4d2420c-a89a-a2d7-2e96-cdce3f06d4c8@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox