From 433b459f8bef83fbf84b4daf9a28653efeed903d Mon Sep 17 00:00:00 2001 From: Robert Read Date: Thu, 18 Mar 2010 13:06:54 -0700 Subject: [PATCH] b=11680 Add /proc/sys/lnet/force_lbug This patch adds a proc entry called force_lbug. a=Christopher J. Morrone i=johann --- libcfs/libcfs/linux/linux-proc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libcfs/libcfs/linux/linux-proc.c b/libcfs/libcfs/linux/linux-proc.c index 553e8f2..a36cf1d 100644 --- a/libcfs/libcfs/linux/linux-proc.c +++ b/libcfs/libcfs/linux/linux-proc.c @@ -104,6 +104,7 @@ enum { PSDEV_LNET_DEBUG_MB, /* size of debug buffer */ PSDEV_LNET_DEBUG_LOG_UPCALL, /* debug log upcall script */ PSDEV_LNET_WATCHDOG_RATELIMIT, /* ratelimit watchdog messages */ + PSDEV_LNET_FORCE_LBUG, /* hook to force an LBUG */ }; #else #define CTL_LNET CTL_UNNUMBERED @@ -331,6 +332,13 @@ int LL_PROC_PROTO(proc_console_backoff) return rc; } +int LL_PROC_PROTO(libcfs_force_lbug) +{ + if (write) + LBUG(); + return 0; +} + static cfs_sysctl_table_t lnet_table[] = { /* * NB No .strategy entries have been provided since sysctl(8) prefers @@ -472,6 +480,13 @@ static cfs_sysctl_table_t lnet_table[] = { .extra1 = &min_watchdog_ratelimit, .extra2 = &max_watchdog_ratelimit, }, + { .ctl_name = PSDEV_LNET_FORCE_LBUG, + .procname = "force_lbug", + .data = NULL, + .maxlen = 0, + .mode = 0200, + .proc_handler = &libcfs_force_lbug + }, {0} }; -- 1.8.3.1