Commit dd04b452 authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds

idr: print a stack dump after ida_remove warning

We print a dump stack after idr_remove warning.  This is useful to find
the faulty piece of code.  Let's do the same for ida_remove, as it would
be equally useful there.

[akpm@linux-foundation.org: convert the open-coded printk+dump_stack into WARN()]
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8bdc237a
...@@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic); ...@@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic);
static void idr_remove_warning(int id) static void idr_remove_warning(int id)
{ {
printk(KERN_WARNING WARN(1, "idr_remove called for id=%d which is not allocated.\n", id);
"idr_remove called for id=%d which is not allocated.\n", id);
dump_stack();
} }
static void sub_remove(struct idr *idp, int shift, int id) static void sub_remove(struct idr *idp, int shift, int id)
...@@ -1064,8 +1062,7 @@ void ida_remove(struct ida *ida, int id) ...@@ -1064,8 +1062,7 @@ void ida_remove(struct ida *ida, int id)
return; return;
err: err:
printk(KERN_WARNING WARN(1, "ida_remove called for id=%d which is not allocated.\n", id);
"ida_remove called for id=%d which is not allocated.\n", id);
} }
EXPORT_SYMBOL(ida_remove); EXPORT_SYMBOL(ida_remove);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment