From: "Mark Peloquin" <peloquin@us.ibm.com>
To: ak@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EVMS core (3/9) discover.c
Date: Thu, 10 Oct 2002 17:05:00 -0500 [thread overview]
Message-ID: <OFDCDB46A2.2BDBA992-ON85256C4E.00748716@pok.ibm.com> (raw)
On 10/10/2002 at 03:48 PM, Andi Kleen wrote:
> > + list_for_each_entry(plugin, &plugin_head, headers) {
> > + if (GetPluginType(plugin->id) == EVMS_DEVICE_MANAGER) {
> > + spin_unlock(&plugin_lock);
> > + DISCOVER(plugin, disk_list);
> > + spin_lock(&plugin_lock);
> > + }
> How do you know "plugin" and its successors are still valid when retaking
> the spinlock? Looks like you need a reference count on the object here.
The spinlock itself should protect the integrity of the
list. If a prev or next element in the list should be
removed, while in a discover function, then the prev
or next field in the current plugin will get updated,
but I don't believe that should cause the list_for_each_entry
macro problems traversing the remainding elements in the list.
The first instruction in every plugin's discover function
is a MOD_INC_USE_COUNT and the last before the return is
MOD_DEC_USE_COUNT. So there exists a small window by
which the current plugin might be unloaded between the
spinlock release and MOD_INC_USE_COUNT, and the
MOD_DEC_USE_COUNT and the spinlock reacquire.
We plan to register a "__this_module.can_unload()" that
should prevent plugin modules from unloading during
discovery.
Mark
next reply other threads:[~2002-10-10 21:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 22:05 Mark Peloquin [this message]
2002-10-10 22:19 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2002-10-10 22:53 Mark Peloquin
[not found] <02101014305502.17770@boiler.suse.lists.linux.kernel>
[not found] ` <02101014352905.17770@boiler.suse.lists.linux.kernel>
2002-10-10 20:48 ` Andi Kleen
2002-10-10 21:15 ` Kevin Corry
2002-10-10 19:30 [PATCH] EVMS core (0/9) Kevin Corry
2002-10-10 19:35 ` [PATCH] EVMS core (3/9) discover.c Kevin Corry
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=OFDCDB46A2.2BDBA992-ON85256C4E.00748716@pok.ibm.com \
--to=peloquin@us.ibm.com \
--cc=ak@suse.de \
--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®