Problem with notifier_lock in notifier_chain_unregister with 2.4.

Adam Radford (aradford@3WARE.com)
Thu, 20 Jul 2000 11:16:06 -0700


I am trying create a patch for the 3ware driver to have it notify the cards
firmware
of a pending shutdown using register_reboot_notifier() and
unregister_reboot_notifier().

The problem is that under SMP, the system gets partially hung in
notifier_chain_unregister()
in kernel/sys.c in this area:

int notifier_chain_unregister(struct notifier_block **nl, struct
notifier_block *n)
{
write_lock (&notifier_lock); ----> The system gets stuck
right here and never gets this lock
while ((*nl)!=NULL)
{
if ((*nl)==n)
{
*nl=n->next;
write_unlock(&notifier_lock);
return 0;
}
nl=&(*nl)->next);
}
write_unlock(&notifier_lock);
return -ENOENT;
}

It is probably worth noting that the 2.2.X kernels don't have this lock
scheme, and removing it fixes the
problem. Is this lock scheme correct in 2.4.0 ?

--
Adam Radford
Software Engineer
3ware, Inc.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/