From: Peter Osterlund <petero2@telia.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Thomas Maier <balagi@justmail.de>,
Jens Axboe <jens.axboe@oracle.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
gregkh@suse.de
Subject: Re: pktcdvd oops
Date: Wed, 7 Nov 2007 23:06:47 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0711072303080.6991@quad.localdomain> (raw)
In-Reply-To: <4731269B.6010509@gmail.com>
On Wed, 7 Nov 2007, Tejun Heo wrote:
> Peter Osterlund wrote:
>> If the
>> __module_get() is not safe because the module code could have already
>> been unloaded, how can it possibly be made safe by adding more code to
>> the pktcdvd module? If the module is unloaded, trying to execute its
>> code can't be a good thing no matter what the code does.
>
> sysfs itself is now out of module lifespan rules. sysfs callbacks are
> guaranteed to stay in memory while running by sysfs node removal waiting
> for completion of in-flight operations before returning. In pktcdvd's
> case, class_destroy() call in pkt_sysfs_cleanup() will wait for all
> in-flight sysfs r/w ops to complete.
>
> So, even while sysfs callbacks are executing, the module beneath can die
> but it will stay in memory till all the callbacks return. You need to
> test module liveness using try_module_get() (and it can fail) if you
> want to grab module reference from sysfs callbacks.
Thanks for the explanation.
Given that explanation, I think the patch is correct and it does fix the
BUG on my computer. Can you please push it upstream?
In any case:
Acked-by: Peter Osterlund <petero2@telia.com>
--
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340
next prev parent reply other threads:[~2007-11-07 22:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071105092018.GD5359@kernel.dk>
2007-11-05 22:19 ` Peter Osterlund
2007-11-06 9:06 ` Tejun Heo
2007-11-06 21:07 ` Thomas Maier
2007-11-06 21:42 ` Peter Osterlund
2007-11-07 2:44 ` Tejun Heo
2007-11-07 22:06 ` Peter Osterlund [this message]
2007-11-08 2:27 ` [PATCH] pktcdvd: fix BUG caused by sysfs module reference semantics change Tejun Heo
2007-11-08 5:24 ` Greg KH
2007-11-08 6:55 ` Tejun Heo
2007-11-08 6:59 ` Jens Axboe
2007-11-08 9:08 Re: pktcdvd oops balagi
2007-11-08 9:34 ` Tejun Heo
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=Pine.LNX.4.64.0711072303080.6991@quad.localdomain \
--to=petero2@telia.com \
--cc=balagi@justmail.de \
--cc=gregkh@suse.de \
--cc=htejun@gmail.com \
--cc=jens.axboe@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®