nvme: fix Kconfig description for BLK_DEV_NVME_SCSI
[linux-2.6-block.git] / lib / list_debug.c
index 3859bf63561c63936947b007fe3ee20e822509a1..3345a089ef7b954d475d67965b8ce891c1b16ab0 100644 (file)
 #include <linux/kernel.h>
 #include <linux/rculist.h>
 
+static struct list_head force_poison;
+void list_force_poison(struct list_head *entry)
+{
+       entry->next = &force_poison;
+       entry->prev = &force_poison;
+}
+
 /*
  * Insert a new entry between two known consecutive entries.
  *
@@ -23,6 +30,8 @@ void __list_add(struct list_head *new,
                              struct list_head *prev,
                              struct list_head *next)
 {
+       WARN(new->next == &force_poison || new->prev == &force_poison,
+               "list_add attempted on force-poisoned entry\n");
        WARN(next->prev != prev,
                "list_add corruption. next->prev should be "
                "prev (%p), but was %p. (next=%p).\n",