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."
--