All of lore.kernel.org
 help / color / mirror / Atom feed
* Removal of dump_stack()s from  /fs/ubifs/io.c
@ 2019-05-15 20:45 ` Shreya Gangan (shgangan)
  0 siblings, 0 replies; 8+ messages in thread
From: Shreya Gangan (shgangan) @ 2019-05-15 20:45 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-kernel

Hi,
    
 /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings. 
Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
Why are these dump_stacks required and what issues might occur upon the removal of these?

Example: 
What is the usecase of the dump_stack in the following code snippet in file /fs/ubifs/io.c?
    if (err) {
    		ubifs_err(c, "changing %d bytes in LEB %d failed, error %d",
    			  len, lnum, err);
    		ubifs_ro_mode(c, err);
    		dump_stack();
    	}
    
Regards,


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Removal of dump_stack()s from  /fs/ubifs/io.c
@ 2019-05-15 20:45 ` Shreya Gangan (shgangan)
  0 siblings, 0 replies; 8+ messages in thread
From: Shreya Gangan (shgangan) @ 2019-05-15 20:45 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-kernel

Hi,
    
 /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings. 
Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
Why are these dump_stacks required and what issues might occur upon the removal of these?

Example: 
What is the usecase of the dump_stack in the following code snippet in file /fs/ubifs/io.c?
    if (err) {
    		ubifs_err(c, "changing %d bytes in LEB %d failed, error %d",
    			  len, lnum, err);
    		ubifs_ro_mode(c, err);
    		dump_stack();
    	}
    
Regards,

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
  2019-05-15 20:45 ` Shreya Gangan (shgangan)
@ 2019-05-15 21:00   ` Richard Weinberger
  -1 siblings, 0 replies; 8+ messages in thread
From: Richard Weinberger @ 2019-05-15 21:00 UTC (permalink / raw)
  To: Shreya Gangan (shgangan); +Cc: linux-mtd, linux-kernel

On Wed, May 15, 2019 at 10:45 PM Shreya Gangan (shgangan)
<shgangan@cisco.com> wrote:
>
> Hi,
>
>  /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings.
> Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
> Why are these dump_stacks required and what issues might occur upon the removal of these?

They are not required, but they are just useful. While you are right
that the locations within UBIFS
are unique, they are not for the whole kernel context.
Filesystem functions can get called via many different paths from VFS...

Why do you want to remove them, what is the benefit?

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
@ 2019-05-15 21:00   ` Richard Weinberger
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Weinberger @ 2019-05-15 21:00 UTC (permalink / raw)
  To: Shreya Gangan (shgangan); +Cc: linux-mtd, linux-kernel

On Wed, May 15, 2019 at 10:45 PM Shreya Gangan (shgangan)
<shgangan@cisco.com> wrote:
>
> Hi,
>
>  /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings.
> Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
> Why are these dump_stacks required and what issues might occur upon the removal of these?

They are not required, but they are just useful. While you are right
that the locations within UBIFS
are unique, they are not for the whole kernel context.
Filesystem functions can get called via many different paths from VFS...

Why do you want to remove them, what is the benefit?

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
  2019-05-15 21:00   ` Richard Weinberger
@ 2019-05-15 23:27     ` Shreya Gangan (shgangan)
  -1 siblings, 0 replies; 8+ messages in thread
From: Shreya Gangan (shgangan) @ 2019-05-15 23:27 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd, linux-kernel

Hi Richard,

On 5/15/19, 2:01 PM, "Richard Weinberger" <richard.weinberger@gmail.com> wrote:

> On Wed, May 15, 2019 at 10:45 PM Shreya Gangan (shgangan) <shgangan@cisco.com> wrote:
> >
> > Hi,
> >
> >  /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings.
> > Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
> > Why are these dump_stacks required and what issues might occur upon the removal of these?

> They are not required, but they are just useful. While you are right that the locations within UBIFS are unique,
> they are not for the whole kernel context.
> Filesystem functions can get called via many different paths from VFS...

Isn't that true for any kernel error though.
Want to understand why it would be essential for ubifs to have these over the other kernel modules? 
Can't the developer add the dump_stack later for debugging reasons?

> Why do you want to remove them, what is the benefit?

The way our system is using the ubifs, for a device which is 'no longer there' could be frequent 
'no such device' errors when
1. there might be multiple write accesses to the filesystem before the responsible process is terminated 
2. the filesystem is unmounted after this
The result would be flooding of the console or message logs with both the error messages and the dump_stack,
making it really ugly.
Is there a specific way a 'no such device' issue is handled to avoid the messages from flooding with the dump_stacks?

Regards,
Shreya


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
@ 2019-05-15 23:27     ` Shreya Gangan (shgangan)
  0 siblings, 0 replies; 8+ messages in thread
From: Shreya Gangan (shgangan) @ 2019-05-15 23:27 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd, linux-kernel

Hi Richard,

On 5/15/19, 2:01 PM, "Richard Weinberger" <richard.weinberger@gmail.com> wrote:

> On Wed, May 15, 2019 at 10:45 PM Shreya Gangan (shgangan) <shgangan@cisco.com> wrote:
> >
> > Hi,
> >
> >  /fs/ubifs/io.c has dump_stack() in multiple functions upon errors and sometimes warnings.
> > Since the error and warning messages seem to be unique, the functional value of these dump_stacks is not apparent.
> > Why are these dump_stacks required and what issues might occur upon the removal of these?

> They are not required, but they are just useful. While you are right that the locations within UBIFS are unique,
> they are not for the whole kernel context.
> Filesystem functions can get called via many different paths from VFS...

Isn't that true for any kernel error though.
Want to understand why it would be essential for ubifs to have these over the other kernel modules? 
Can't the developer add the dump_stack later for debugging reasons?

> Why do you want to remove them, what is the benefit?

The way our system is using the ubifs, for a device which is 'no longer there' could be frequent 
'no such device' errors when
1. there might be multiple write accesses to the filesystem before the responsible process is terminated 
2. the filesystem is unmounted after this
The result would be flooding of the console or message logs with both the error messages and the dump_stack,
making it really ugly.
Is there a specific way a 'no such device' issue is handled to avoid the messages from flooding with the dump_stacks?

Regards,
Shreya

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
  2019-05-15 23:27     ` Shreya Gangan (shgangan)
@ 2019-05-16  8:27       ` Richard Weinberger
  -1 siblings, 0 replies; 8+ messages in thread
From: Richard Weinberger @ 2019-05-16  8:27 UTC (permalink / raw)
  To: Shreya Gangan (shgangan); +Cc: linux-mtd, linux-kernel

----- Ursprüngliche Mail -----
>> They are not required, but they are just useful. While you are right that the
>> locations within UBIFS are unique,
>> they are not for the whole kernel context.
>> Filesystem functions can get called via many different paths from VFS...
> 
> Isn't that true for any kernel error though.
> Want to understand why it would be essential for ubifs to have these over the
> other kernel modules?
> Can't the developer add the dump_stack later for debugging reasons?

In UBIFS the dump_stack() calls are more or less a WARN_ON().
Such situations should not happen. If they do, we want the details.

So, in the long rung we could replace most of them by a WARN_ON().
Maybe even WARN_ON_ONCE().

>> Why do you want to remove them, what is the benefit?
> 
> The way our system is using the ubifs, for a device which is 'no longer there'
> could be frequent
> 'no such device' errors when
> 1. there might be multiple write accesses to the filesystem before the
> responsible process is terminated
> 2. the filesystem is unmounted after this
> The result would be flooding of the console or message logs with both the error
> messages and the dump_stack,
> making it really ugly.
> Is there a specific way a 'no such device' issue is handled to avoid the
> messages from flooding with the dump_stacks?

I don't follow, sorry.

If your system too noisy, fix the log level. But usually when UBIFS prints
an error followed by a stack trace, it is something serious you should address
and not trying to make the error message look less scary.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of dump_stack()s from /fs/ubifs/io.c
@ 2019-05-16  8:27       ` Richard Weinberger
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Weinberger @ 2019-05-16  8:27 UTC (permalink / raw)
  To: Shreya Gangan (shgangan); +Cc: linux-mtd, linux-kernel

----- Ursprüngliche Mail -----
>> They are not required, but they are just useful. While you are right that the
>> locations within UBIFS are unique,
>> they are not for the whole kernel context.
>> Filesystem functions can get called via many different paths from VFS...
> 
> Isn't that true for any kernel error though.
> Want to understand why it would be essential for ubifs to have these over the
> other kernel modules?
> Can't the developer add the dump_stack later for debugging reasons?

In UBIFS the dump_stack() calls are more or less a WARN_ON().
Such situations should not happen. If they do, we want the details.

So, in the long rung we could replace most of them by a WARN_ON().
Maybe even WARN_ON_ONCE().

>> Why do you want to remove them, what is the benefit?
> 
> The way our system is using the ubifs, for a device which is 'no longer there'
> could be frequent
> 'no such device' errors when
> 1. there might be multiple write accesses to the filesystem before the
> responsible process is terminated
> 2. the filesystem is unmounted after this
> The result would be flooding of the console or message logs with both the error
> messages and the dump_stack,
> making it really ugly.
> Is there a specific way a 'no such device' issue is handled to avoid the
> messages from flooding with the dump_stacks?

I don't follow, sorry.

If your system too noisy, fix the log level. But usually when UBIFS prints
an error followed by a stack trace, it is something serious you should address
and not trying to make the error message look less scary.

Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-05-16  8:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 20:45 Removal of dump_stack()s from /fs/ubifs/io.c Shreya Gangan (shgangan)
2019-05-15 20:45 ` Shreya Gangan (shgangan)
2019-05-15 21:00 ` Richard Weinberger
2019-05-15 21:00   ` Richard Weinberger
2019-05-15 23:27   ` Shreya Gangan (shgangan)
2019-05-15 23:27     ` Shreya Gangan (shgangan)
2019-05-16  8:27     ` Richard Weinberger
2019-05-16  8:27       ` Richard Weinberger

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.