From 4bc9bae59fea315bdd36e8170e8388d5fce2a397 Mon Sep 17 00:00:00 2001 From: Alexander Zarochentsev Date: Thu, 10 Sep 2015 09:26:43 +0300 Subject: [PATCH] LU-8418 libcfs: remove lnet upcall code Removing lnet upcall infrastructure completely as nobody uses it anymore. The upcall causes a delay before calling BUG() and might even cause a hang making getting a crash dump unreliable or containing outdated info. Change-Id: I20af6874116542d16bcc9a9eb75c813a124e346d Seagate-bug-id: MRP-2939 Signed-off-by: Alexander Zarochentsev Reviewed-on: http://review.whamcloud.com/21440 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/libcfs_private.h | 2 -- libcfs/libcfs/linux/linux-debug.c | 56 ---------------------------------- libcfs/libcfs/module.c | 8 ----- libcfs/libcfs/tracefile.h | 1 - lustre/ldlm/ldlm_lockd.c | 5 --- 5 files changed, 72 deletions(-) diff --git a/libcfs/include/libcfs/libcfs_private.h b/libcfs/include/libcfs/libcfs_private.h index b46fb77..22d2a5e 100644 --- a/libcfs/include/libcfs/libcfs_private.h +++ b/libcfs/include/libcfs/libcfs_private.h @@ -246,8 +246,6 @@ do { \ #endif void libcfs_debug_dumpstack(struct task_struct *tsk); -void libcfs_run_upcall(char **argv); -void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *); void libcfs_debug_dumplog(void); int libcfs_debug_init(unsigned long bufsize); int libcfs_debug_cleanup(void); diff --git a/libcfs/libcfs/linux/linux-debug.c b/libcfs/libcfs/linux/linux-debug.c index 40ae258..5044cde 100644 --- a/libcfs/libcfs/linux/linux-debug.c +++ b/libcfs/libcfs/linux/linux-debug.c @@ -64,7 +64,6 @@ #include -char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall"; char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_upcall"; /** @@ -102,60 +101,6 @@ void libcfs_run_debug_log_upcall(char *file) EXIT; } -void libcfs_run_upcall(char **argv) -{ - int rc; - int argc; - char *envp[] = { - "HOME=/", - "PATH=/sbin:/bin:/usr/sbin:/usr/bin", - NULL}; - ENTRY; - - argv[0] = lnet_upcall; - argc = 1; - while (argv[argc] != NULL) - argc++; - - LASSERT(argc >= 2); - - rc = call_usermodehelper(argv[0], argv, envp, 1); - if (rc < 0 && rc != -ENOENT) { - CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; " - "check /proc/sys/lnet/upcall\n", - rc, argv[0], argv[1], - argc < 3 ? "" : ",", argc < 3 ? "" : argv[2], - argc < 4 ? "" : ",", argc < 4 ? "" : argv[3], - argc < 5 ? "" : ",", argc < 5 ? "" : argv[4], - argc < 6 ? "" : ",..."); - } else { - CDEBUG(D_HA, "Invoked LNET upcall %s %s%s%s%s%s%s%s%s\n", - argv[0], argv[1], - argc < 3 ? "" : ",", argc < 3 ? "" : argv[2], - argc < 4 ? "" : ",", argc < 4 ? "" : argv[3], - argc < 5 ? "" : ",", argc < 5 ? "" : argv[4], - argc < 6 ? "" : ",..."); - } -} - -void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata) -{ - char *argv[6]; - char buf[32]; - - ENTRY; - snprintf (buf, sizeof buf, "%d", msgdata->msg_line); - - argv[1] = "LBUG"; - argv[2] = (char *)msgdata->msg_file; - argv[3] = (char *)msgdata->msg_fn; - argv[4] = buf; - argv[5] = NULL; - - libcfs_run_upcall (argv); -} -EXPORT_SYMBOL(libcfs_run_lbug_upcall); - /* coverity[+kill] */ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) { @@ -170,7 +115,6 @@ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) libcfs_debug_dumpstack(NULL); if (!libcfs_panic_on_lbug) libcfs_debug_dumplog(); - libcfs_run_lbug_upcall(msgdata); if (libcfs_panic_on_lbug) panic("LBUG"); set_task_state(current, TASK_UNINTERRUPTIBLE); diff --git a/libcfs/libcfs/module.c b/libcfs/libcfs/module.c index a3c3ea2..3920e39 100644 --- a/libcfs/libcfs/module.c +++ b/libcfs/libcfs/module.c @@ -538,14 +538,6 @@ static struct ctl_table lnet_table[] = { }, { INIT_CTL_NAME - .procname = "upcall", - .data = lnet_upcall, - .maxlen = sizeof(lnet_upcall), - .mode = 0644, - .proc_handler = &proc_dostring, - }, - { - INIT_CTL_NAME .procname = "debug_log_upcall", .data = lnet_debug_log_upcall, .maxlen = sizeof(lnet_debug_log_upcall), diff --git a/libcfs/libcfs/tracefile.h b/libcfs/libcfs/tracefile.h index 69ce99a..2f5dc4f 100644 --- a/libcfs/libcfs/tracefile.h +++ b/libcfs/libcfs/tracefile.h @@ -48,7 +48,6 @@ enum cfs_trace_buf_type { extern char cfs_tracefile[TRACEFILE_NAME_SIZE]; extern long long cfs_tracefile_size; -extern char lnet_upcall[1024]; /** * The path of debug log dump upcall script. */ diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index c2a420d..ee91020 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -180,15 +180,10 @@ static int expired_lock_main(void *arg) spin_lock_bh(&waiting_locks_spinlock); if (expired_lock_thread.elt_dump) { - struct libcfs_debug_msg_data msgdata = { - .msg_file = __FILE__, - .msg_fn = "waiting_locks_callback", - .msg_line = expired_lock_thread.elt_dump }; spin_unlock_bh(&waiting_locks_spinlock); /* from waiting_locks_callback, but not in timer */ libcfs_debug_dumplog(); - libcfs_run_lbug_upcall(&msgdata); spin_lock_bh(&waiting_locks_spinlock); expired_lock_thread.elt_dump = 0; -- 1.8.3.1