linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* exit from log_printf()
@ 2020-04-27 12:30 Yauheni Kaliuta
  2020-04-29  6:44 ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Yauheni Kaliuta @ 2020-04-27 12:30 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

Hi, Lucas!

I have a question about exit call from tools/log.c:log_printf()
(https://github.com/lucasdemarchi/kmod/blob/master/tools/log.c#L140)

What is the reasoning behind that?

At the first glance it looks a bit incorrect (pretty surprising
to have exit in print()).

Discovered while trying to remove several modules when one of
them cannod be removed:

$ modprobe -r libata pcspkr       
modprobe: FATAL: Module libata is in use.

$ lsmod | grep pcsp
pcspkr                 16384  0


-- 
WBR,
Yauheni Kaliuta


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

* Re: exit from log_printf()
  2020-04-27 12:30 exit from log_printf() Yauheni Kaliuta
@ 2020-04-29  6:44 ` Lucas De Marchi
  2020-04-29  8:24   ` Yauheni Kaliuta
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2020-04-29  6:44 UTC (permalink / raw)
  To: Yauheni Kaliuta; +Cc: Lucas De Marchi, linux-modules

On Mon, Apr 27, 2020 at 5:31 AM Yauheni Kaliuta
<yauheni.kaliuta@redhat.com> wrote:
>
> Hi, Lucas!
>
> I have a question about exit call from tools/log.c:log_printf()
> (https://github.com/lucasdemarchi/kmod/blob/master/tools/log.c#L140)
>
> What is the reasoning behind that?
>
> At the first glance it looks a bit incorrect (pretty surprising
> to have exit in print()).

If we log a critical error, there's nothing we can do except exit.
Note that this is only
used by the binaries, not the library.

There's potential for abuse, but it's pretty common to have something
with that behavior.

Lucas De Marchi

>
> Discovered while trying to remove several modules when one of
> them cannod be removed:
>
> $ modprobe -r libata pcspkr
> modprobe: FATAL: Module libata is in use.
>
> $ lsmod | grep pcsp
> pcspkr                 16384  0
>
>
> --
> WBR,
> Yauheni Kaliuta
>


-- 
Lucas De Marchi

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

* Re: exit from log_printf()
  2020-04-29  6:44 ` Lucas De Marchi
@ 2020-04-29  8:24   ` Yauheni Kaliuta
  0 siblings, 0 replies; 3+ messages in thread
From: Yauheni Kaliuta @ 2020-04-29  8:24 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Lucas De Marchi, linux-modules

Hi, Lucas!

>>>>> On Tue, 28 Apr 2020 23:44:03 -0700, Lucas De Marchi  wrote:

 > On Mon, Apr 27, 2020 at 5:31 AM Yauheni Kaliuta
 > <yauheni.kaliuta@redhat.com> wrote:
 >> 
 >> Hi, Lucas!
 >> 
 >> I have a question about exit call from tools/log.c:log_printf()
 >> (https://github.com/lucasdemarchi/kmod/blob/master/tools/log.c#L140)
 >> 
 >> What is the reasoning behind that?
 >> 
 >> At the first glance it looks a bit incorrect (pretty surprising
 >> to have exit in print()).

 > If we log a critical error, there's nothing we can do except
 > exit.  Note that this is only used by the binaries, not the
 > library.

So, it should not be fatal then, right? See the usecase below.


 > There's potential for abuse, but it's pretty common to have
 > something with that behavior.

 > Lucas De Marchi

 >> 
 >> Discovered while trying to remove several modules when one of
 >> them cannod be removed:
 >> 
 >> $ modprobe -r libata pcspkr
 >> modprobe: FATAL: Module libata is in use.
 >> 
 >> $ lsmod | grep pcsp
 >> pcspkr                 16384  0
 >> 
 >> 
 >> --
 >> WBR,
 >> Yauheni Kaliuta
 >> 


 > -- 
 > Lucas De Marchi


-- 
WBR,
Yauheni Kaliuta


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

end of thread, other threads:[~2020-04-29  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 12:30 exit from log_printf() Yauheni Kaliuta
2020-04-29  6:44 ` Lucas De Marchi
2020-04-29  8:24   ` Yauheni Kaliuta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).