Re: [PATCH v4 02/15] PCI Hotplug: serialize pci_hp_register/deregister

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matthew Wilcox
Date: Monday, October 6, 2008 - 7:45 am

On Fri, Oct 03, 2008 at 05:17:37PM -0600, Alex Chiang wrote:

I'm torn between saying this goes too far and this doesn't go far
enough.  If pci_hp_register() and pci_hp_deregister() can race against
each other, then I don't like the way we grab, release, grab, release
the pci_hotplug_slot_list_lock in pci_hp_deregister()/get_slot_from_name().
I think it would be smarter to grab the pci_hotplug_slot_list_lock
before calling get_slot_from_name() and release it after the list_del().

Mind you, I can't see a race there, but I'm also not at my best today
and it's possible there's one there I can't see.

As it currently stands, I don't think it needs to be a mutex -- do we do
anything sleeping under it?

Another part of me says "Just slap a mutex around both functions and
have done with it".

So, in summary, more eyes on this please.  I don't think I can do a good
job today at spotting races.


Gratuitous whitespace change?

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v4 00/15] PCI: let the core manage slot names, Alex Chiang, (Fri Oct 3, 4:17 pm)
[PATCH v4 03/15] PCI: prevent duplicate slot names, Alex Chiang, (Fri Oct 3, 4:17 pm)
[PATCH v4 14/15] PCI: Hotplug core: remove 'name', Alex Chiang, (Fri Oct 3, 4:18 pm)
Re: [PATCH v4 02/15] PCI Hotplug: serialize pci_hp_registe ..., Matthew Wilcox, (Mon Oct 6, 7:45 am)
Re: [PATCH v4 03/15] PCI: prevent duplicate slot names, Kenji Kaneshige, (Tue Oct 7, 11:00 pm)
Re: [PATCH v4 00/15] PCI: let the core manage slot names, Kenji Kaneshige, (Tue Oct 7, 11:31 pm)
[01/03] Sample patch for [PATCH v4 02/15] , Kenji Kaneshige, (Tue Oct 7, 11:33 pm)
[02/03] Sample patch for [PATCH v4 03/15], Kenji Kaneshige, (Tue Oct 7, 11:34 pm)
[03/03] Sample patch for [PATCH v4 14/15], Kenji Kaneshige, (Tue Oct 7, 11:36 pm)
Re: [PATCH v4 00/15] PCI: let the core manage slot names, Kenji Kaneshige, (Wed Oct 8, 10:01 pm)