All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard.weinberger@gmail.com>
To: Xenomai <xenomai@xenomai.org>
Subject: RTDM module ownership
Date: Thu, 2 Jul 2020 10:32:39 +0200	[thread overview]
Message-ID: <CAFLxGvxru2Y==qboUgwHdsQvOT5MEL2O8CexkhkQpKz0Qj+jqw@mail.gmail.com> (raw)

Hi!

I'm working on a kernel module which is used on plain Linux and
Xenomai (RTDM), while reviewing RTDM to understand refcounting I found
something that is not entirely clear to me.

Why does __rtdm_dev_open() not grab a reference on the RTDM module owner?
This leads to the case where one can rmmod the module while it is in use.
Unloading will block uninterruptible in rtdm_dev_unregister() in the
module's cleanup funktion.

In contrast, on regular Linux rmmod will refuse to unload the module
if the device node is still open because fops_get() or other helpers
gained a reference on the owner.

-- 
Thanks,
//richard


             reply	other threads:[~2020-07-02  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  8:32 Richard Weinberger [this message]
2020-07-03  6:14 ` RTDM module ownership Jan Kiszka
2020-07-03  6:22   ` Richard Weinberger
2020-07-03  9:10     ` Jan Kiszka
2020-07-03  9:26       ` Richard Weinberger

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='CAFLxGvxru2Y==qboUgwHdsQvOT5MEL2O8CexkhkQpKz0Qj+jqw@mail.gmail.com' \
    --to=richard.weinberger@gmail.com \
    --cc=xenomai@xenomai.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.