Linux-Modules Archive on lore.kernel.org
 help / color / Atom feed
From: Lucas De Marchi <lucas.de.marchi@gmail.com>
To: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	linux-modules <linux-modules@vger.kernel.org>
Subject: Re: exit from log_printf()
Date: Tue, 28 Apr 2020 23:44:03 -0700
Message-ID: <CAKi4VALCzXJdZY-ABC-tZ=wpyfM0m-CE02FdZ3nDD2q-AE8kog@mail.gmail.com> (raw)
In-Reply-To: <xuny7dy1glgs.fsf@redhat.com>

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

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 12:30 Yauheni Kaliuta
2020-04-29  6:44 ` Lucas De Marchi [this message]
2020-04-29  8:24   ` Yauheni Kaliuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKi4VALCzXJdZY-ABC-tZ=wpyfM0m-CE02FdZ3nDD2q-AE8kog@mail.gmail.com' \
    --to=lucas.de.marchi@gmail.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=yauheni.kaliuta@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org
	public-inbox-index linux-modules

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git