Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Thu, 14 Jun 2007 09:16:49 +0000 (09:16 +0000)
committerbobijam <bobijam>
Thu, 14 Jun 2007 09:16:49 +0000 (09:16 +0000)
b=11680
i=wangdi
i=shadow

Description: make panic on lbug configurable

lnet/ChangeLog
lnet/include/libcfs/libcfs.h
lnet/libcfs/debug.c
lnet/libcfs/linux/linux-debug.c
lnet/libcfs/linux/linux-proc.c

index 15e76fb..c388239 100644 (file)
        ptllnd    - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x
        * bug fixes
 
+Severity   : normal
+Bugzilla   : 11680
+Description: make panic on lbug configurable
+
 ------------------------------------------------------------------------------
 
 2007-04-01  Cluster File Systems, Inc. <info@clusterfs.com>
index b57f2ab..188924e 100644 (file)
@@ -76,6 +76,7 @@ int libcfs_debug_str2mask(int *mask, const char *str, int is_subsys);
 
 /* Has there been an LBUG? */
 extern unsigned int libcfs_catastrophe;
+extern unsigned int libcfs_panic_on_lbug;
 
 /*
  * struct ptldebug_header is defined in libcfs/<os>/libcfs.h
index 5de53f4..f5aff7f 100644 (file)
@@ -59,6 +59,9 @@ EXPORT_SYMBOL(portal_enter_debugger);
 unsigned int libcfs_catastrophe;
 EXPORT_SYMBOL(libcfs_catastrophe);
 
+unsigned int libcfs_panic_on_lbug = 0;
+EXPORT_SYMBOL(libcfs_panic_on_lbug);
+
 atomic_t libcfs_kmemory = ATOMIC_INIT(0);
 EXPORT_SYMBOL(libcfs_kmemory);
 
index 4a48ae6..93cddd8 100644 (file)
@@ -142,6 +142,8 @@ void lbug_with_loc(char *file, const char *func, const int line)
         libcfs_debug_dumpstack(NULL);
         libcfs_debug_dumplog();
         libcfs_run_lbug_upcall(file, func, line);
+        if (libcfs_panic_on_lbug)
+                panic("LBUG");
         set_task_state(current, TASK_UNINTERRUPTIBLE);
         while (1)
                 schedule();
index b090d1d..c0bd793 100644 (file)
@@ -73,6 +73,7 @@ enum {
         PSDEV_LNET_UPCALL,        /* User mode upcall script  */
         PSDEV_LNET_MEMUSED,       /* bytes currently PORTAL_ALLOCated */
         PSDEV_LNET_CATASTROPHE,   /* if we have LBUGged or panic'd */
+        PSDEV_LNET_PANIC_ON_LBUG, /* flag to panic on LBUG */
 };
 
 int LL_PROC_PROTO(proc_dobitmasks);
@@ -146,6 +147,14 @@ static struct ctl_table lnet_table[] = {
                 .mode     = 0444,
                 .proc_handler = &proc_dointvec
         },
+        {
+                .ctl_name = PSDEV_LNET_PANIC_ON_LBUG,
+                .procname = "panic_on_lbug",
+                .data     = &libcfs_panic_on_lbug,
+                .maxlen   = sizeof(int),
+                .mode     = 0444,
+                .proc_handler = &proc_dointvec
+        },
         {0}
 };