[Devel] [PATCH RHEL7 COMMIT] ms/idr: print a stack dump after ida_remove warning

Konstantin Khorenko khorenko at virtuozzo.com
Thu May 28 05:46:29 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.7
------>
commit 69800eb688b7ca1d713dd3bd73b4a83fb040647d
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Thu May 28 16:46:29 2015 +0400

    ms/idr: print a stack dump after ida_remove warning
    
    backport of mainline commit dd04b452f532ca100f7c557295ffcbc049c77171
    Author: Jean Delvare <jdelvare at suse.de>
    Date:   Wed Jul 3 15:08:47 2013 -0700
    
        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 at linux-foundation.org: convert the open-coded printk+dump_stack into WARN()]
        Signed-off-by: Jean Delvare <jdelvare at suse.de>
        Cc: Tejun Heo <tj at kernel.org>
        Cc: Takashi Iwai <tiwai at suse.de>
        Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
        Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
    
    https://bugzilla.openvz.org/show_bug.cgi?id=3117
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 lib/idr.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/idr.c b/lib/idr.c
index a3bfde8..674c30b 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic);
 
 static void idr_remove_warning(int id)
 {
-	printk(KERN_WARNING
-		"idr_remove called for id=%d which is not allocated.\n", id);
-	dump_stack();
+	WARN(1, "idr_remove called for id=%d which is not allocated.\n", id);
 }
 
 static void sub_remove(struct idr *idp, int shift, int id)
@@ -1062,8 +1060,7 @@ void ida_remove(struct ida *ida, int id)
 	return;
 
  err:
-	printk(KERN_WARNING
-	       "ida_remove called for id=%d which is not allocated.\n", id);
+	WARN(1, "ida_remove called for id=%d which is not allocated.\n", id);
 }
 EXPORT_SYMBOL(ida_remove);
 



More information about the Devel mailing list