Re: [PATCH] IPMI: fix some RCU problems
From: Christoph Hellwig
Date: Thu Dec 28 2006 - 13:31:25 EST
> + if (list_empty(&intf->cmd_rcvrs))
> + INIT_LIST_HEAD(&list);
> + else {
> + list.next = intf->cmd_rcvrs.next;
> + list.prev = intf->cmd_rcvrs.prev;
> + INIT_LIST_HEAD(&intf->cmd_rcvrs);
> +
> + /*
> + * At this point the list body still points to
> + * intf->cmd_rcvrs. Wait for any readers to finish
> + * using the list before we switch the list body over
> + * to the new list.
> + */
> + synchronize_rcu();
> +
> + /* Ready the list for use. */
> + list.next->prev = &list;
> + list.prev->next = &list;
> + }
This kind of thing must not be opencoded in drivers. Please add
a new list_splice_rcu helper to list.h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/