Query on ubifs_assert
pavi1729
pavitra1729 at gmail.com
Tue Jul 7 00:29:53 PDT 2015
Richard,
Just wondering ..
On Wed, Jul 1, 2015 at 7:41 PM, Richard Weinberger
<richard.weinberger at gmail.com> wrote:
> On Wed, Jul 1, 2015 at 1:03 PM, pavi1729 <pavitra1729 at gmail.com> wrote:
>> Hi,
>>
>> FILE: fs/ubifs/misc.h :
>> FUNCTION : ubifs_compr_present
>>
>> "ubifs_compr_present" function has "ubifs_assert" which checks for the
>> valid compression value
>> and does a stack_dump if not.
>>
>> Could there be a case where the "compr_type" is corrupt; if yes, then
>> does a stack_dump suffice?
>> Thus if compr_type is invalid then the below return is not reliable.
>> return !!ubifs_compressors[compr_type]->capi_name;
>
> If compr_type is invalid something nasty is happening and the kernel will crash
> at some point.
> But using the ubifs_assert() we can see at least what went wrong.
.. if we know for sure that, the kernel will crash, then why not panic
here and halt the system.
We know for sure that it is going to crash anyways.
>
>> So where does this end, eventually does it go to a point where the
>> volume get corrupt and not unmountable ?
>
> As I said, if that value is corrupt we are already in trouble.
> The purpose of the assert is to report which value is bad.
>
> --
> Thanks,
> //richard
More information about the linux-mtd
mailing list