[U-Boot] UBIFS fails on SheevaPlug

Andreas Bießmann andreas.devel at googlemail.com
Tue Oct 30 00:02:05 CET 2012


Dear Vikram Narayanan,

first of all you are right. u-boot ubifs implementation will never 
recover the ubifs on media, cause it is mounted read only.

On 29.10.2012 19:53, Vikram Narayanan wrote:
> On 10/29/2012 10:55 PM, Dimax wrote:
>> I remember I have unbricked sheevaplug with USB key.
>> But I'm still not sure if effort is not useless as I see no conclusion
>> about u-boot ability to recover UBIFS partition (at least to try).
>> Can anybody tell it for sure?
>
> This is what I've got from the code [1].
>
> Code flow
> ---------
> common/cmd_ubifs.c:
> do_ubifs_mount calls ubifs_mount
>
> fs/ubifs/super.c,
> In ubifs_mount()  (line 1167)
> 	flags = MS_RDONLY;	(line 1188)
> calls ubifs_get_sb (with flags as a param)
> ubifs_get_sb (line 1018)
> The flags get updated here.
> 	sb->s_flags = flags; (line 1057)

calls sget() (line 1043)
which in turn calls kzalloc() (line 67)
which may return -ENOMEM

But u-boot will manage to get the data out of the unordered ubifs (if no 
error like this ENOMEM occur). That is the same process as in kernel if 
it is mounted read-only (recovery deferred).
So if the kernel can manage to mount the unordered ubifs u-boot should 
do so. If it can't (but the kernel can) there is an error that should be 
fixed.

Best regards

Andreas Bießmann


More information about the U-Boot mailing list