* Query on ubifs_assert
@ 2015-07-01 11:03 pavi1729
2015-07-01 14:11 ` Richard Weinberger
0 siblings, 1 reply; 6+ messages in thread
From: pavi1729 @ 2015-07-01 11:03 UTC (permalink / raw)
To: linux-mtd
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;
So where does this end, eventually does it go to a point where the
volume get corrupt and not unmountable ?
PS: If this is a very basic query do let me know, I can push this to
KernelNewbies mailing list.
Thanks,
PK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Query on ubifs_assert
@ 2015-07-01 11:10 pavi1729
0 siblings, 0 replies; 6+ messages in thread
From: pavi1729 @ 2015-07-01 11:10 UTC (permalink / raw)
To: kernelnewbies
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;
So where does this end, eventually does it go to a point where the
volume get corrupt and not unmountable ?
Cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Query on ubifs_assert
2015-07-01 11:03 Query on ubifs_assert pavi1729
@ 2015-07-01 14:11 ` Richard Weinberger
2015-07-01 18:24 ` pavi1729
2015-07-07 7:29 ` pavi1729
0 siblings, 2 replies; 6+ messages in thread
From: Richard Weinberger @ 2015-07-01 14:11 UTC (permalink / raw)
To: pavi1729; +Cc: linux-mtd@lists.infradead.org
On Wed, Jul 1, 2015 at 1:03 PM, pavi1729 <pavitra1729@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.
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Query on ubifs_assert
2015-07-01 14:11 ` Richard Weinberger
@ 2015-07-01 18:24 ` pavi1729
2015-07-07 7:29 ` pavi1729
1 sibling, 0 replies; 6+ messages in thread
From: pavi1729 @ 2015-07-01 18:24 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-mtd@lists.infradead.org
Thanks Richard.. that helped.
Started with UBI.. like 3 days back. Will keep digging.
On Wed, Jul 1, 2015 at 7:41 PM, Richard Weinberger
<richard.weinberger@gmail.com> wrote:
> On Wed, Jul 1, 2015 at 1:03 PM, pavi1729 <pavitra1729@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.
>
>> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Query on ubifs_assert
2015-07-01 14:11 ` Richard Weinberger
2015-07-01 18:24 ` pavi1729
@ 2015-07-07 7:29 ` pavi1729
2015-07-07 7:37 ` Richard Weinberger
1 sibling, 1 reply; 6+ messages in thread
From: pavi1729 @ 2015-07-07 7:29 UTC (permalink / raw)
To: Richard Weinberger; +Cc: linux-mtd@lists.infradead.org
Richard,
Just wondering ..
On Wed, Jul 1, 2015 at 7:41 PM, Richard Weinberger
<richard.weinberger@gmail.com> wrote:
> On Wed, Jul 1, 2015 at 1:03 PM, pavi1729 <pavitra1729@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Query on ubifs_assert
2015-07-07 7:29 ` pavi1729
@ 2015-07-07 7:37 ` Richard Weinberger
0 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2015-07-07 7:37 UTC (permalink / raw)
To: pavi1729; +Cc: linux-mtd@lists.infradead.org
Am 07.07.2015 um 09:29 schrieb pavi1729:
> Richard,
> Just wondering ..
>
> On Wed, Jul 1, 2015 at 7:41 PM, Richard Weinberger
> <richard.weinberger@gmail.com> wrote:
>> On Wed, Jul 1, 2015 at 1:03 PM, pavi1729 <pavitra1729@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.
Because we don't want to stop the machine. Maybe only the current thread
dies...
But I'm sure some ubifs_assert() could be converted to WARN_ON().
Thanks,
//richard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-07-07 7:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01 11:03 Query on ubifs_assert pavi1729
2015-07-01 14:11 ` Richard Weinberger
2015-07-01 18:24 ` pavi1729
2015-07-07 7:29 ` pavi1729
2015-07-07 7:37 ` Richard Weinberger
-- strict thread matches above, loose matches on Subject: below --
2015-07-01 11:10 pavi1729
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.