diff --git a/lnet/ChangeLog b/lnet/ChangeLog index 15e76fb505bca949c4883501446964ea2925a1c3..c388239a1fa48a58c27755fe8d57373d4f7d7d6d 100644 --- a/lnet/ChangeLog +++ b/lnet/ChangeLog @@ -13,6 +13,10 @@ 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> diff --git a/lnet/include/libcfs/libcfs.h b/lnet/include/libcfs/libcfs.h index b57f2abb9ff8cc09386227e217fce620d82150e2..188924ebaa64c7f69b8a17f6539b4ec3b6262450 100644 --- a/lnet/include/libcfs/libcfs.h +++ b/lnet/include/libcfs/libcfs.h @@ -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 diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 5de53f413a670a9903dd82fbab126ce9c3808774..f5aff7fe8176b6caed1ba16846e4b74b39feae91 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -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); diff --git a/lnet/libcfs/linux/linux-debug.c b/lnet/libcfs/linux/linux-debug.c index 4a48ae63595ff6048419cad3a51bb57b934fbe36..93cddd83c77643c00752ee21c1b4ddd22b3a2bed 100644 --- a/lnet/libcfs/linux/linux-debug.c +++ b/lnet/libcfs/linux/linux-debug.c @@ -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(); diff --git a/lnet/libcfs/linux/linux-proc.c b/lnet/libcfs/linux/linux-proc.c index b090d1d4cf25d772e526a1ab4801861edee6f01d..c0bd793eb9ea984b4eeb0ee37bc59ee93e9da90a 100644 --- a/lnet/libcfs/linux/linux-proc.c +++ b/lnet/libcfs/linux/linux-proc.c @@ -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} };