All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Artem B. Bityutskiy" <dedekind@yandex.ru>
To: linux-kernel@vger.kernel.org
Subject: Re: [QUESTION/sysfs] strange refcounting
Date: Sat, 04 Feb 2006 15:04:45 +0300	[thread overview]
Message-ID: <43E4985D.3070708@yandex.ru> (raw)
In-Reply-To: <1139040821.13125.4.camel@sauron.oktetlabs.ru>

Artem B. Bityutskiy wrote:
> Then, I see /sys/devices/mydev/ in sysfs. I open
> pre-defined /sys/devices/mydev/power/state in userspace and don't close it. 
> 
> Then I run lsmod, and see zero refcount to my module. Well, I run rmmod
> mymod, module is unloaded. 
> 
> Then I close /sys/devices/mydev/power/state, and enjoy segfault. 
> 
I actually forgot to formulate my question: why module's refcount is not 
increased when somebody opens a sysfs file which belongs to this module? 
How to withstan to an unexpected module unload?

Thanks.

-- 
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.

  reply	other threads:[~2006-02-04 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-04  8:13 [QUESTION/sysfs] strange refcounting Artem B. Bityutskiy
2006-02-04 12:04 ` Artem B. Bityutskiy [this message]
2006-02-04 13:33   ` Artem B. Bityutskiy
2006-02-06  9:58     ` Artem B. Bityutskiy
2006-02-06 17:20       ` Artem B. Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2006-02-03 14:16 Artem B. Bityutskiy
2006-02-03 17:08 ` Greg KH

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=43E4985D.3070708@yandex.ru \
    --to=dedekind@yandex.ru \
    --cc=linux-kernel@vger.kernel.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.