Whamcloud - gitweb
LU-8418 libcfs: remove lnet upcall code 40/21440/6
authorAlexander Zarochentsev <alexander.zarochentsev@seagate.com>
Thu, 10 Sep 2015 06:26:43 +0000 (09:26 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 19 Nov 2016 15:48:34 +0000 (15:48 +0000)
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 <alexander.zarochentsev@seagate.com>
Reviewed-on: http://review.whamcloud.com/21440
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/libcfs_private.h
libcfs/libcfs/linux/linux-debug.c
libcfs/libcfs/module.c
libcfs/libcfs/tracefile.h
lustre/ldlm/ldlm_lockd.c

index b46fb77..22d2a5e 100644 (file)
@@ -246,8 +246,6 @@ do {                                                                        \
 #endif
 
 void libcfs_debug_dumpstack(struct task_struct *tsk);
 #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);
 void libcfs_debug_dumplog(void);
 int libcfs_debug_init(unsigned long bufsize);
 int libcfs_debug_cleanup(void);
index 40ae258..5044cde 100644 (file)
@@ -64,7 +64,6 @@
 
 #include <linux/kallsyms.h>
 
 
 #include <linux/kallsyms.h>
 
-char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall";
 char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_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;
 }
 
         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)
 {
 /* 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_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);
         if (libcfs_panic_on_lbug)
                 panic("LBUG");
         set_task_state(current, TASK_UNINTERRUPTIBLE);
index a3c3ea2..3920e39 100644 (file)
@@ -538,14 +538,6 @@ static struct ctl_table lnet_table[] = {
        },
        {
                INIT_CTL_NAME
        },
        {
                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),
                .procname       = "debug_log_upcall",
                .data           = lnet_debug_log_upcall,
                .maxlen         = sizeof(lnet_debug_log_upcall),
index 69ce99a..2f5dc4f 100644 (file)
@@ -48,7 +48,6 @@ enum cfs_trace_buf_type {
 extern char      cfs_tracefile[TRACEFILE_NAME_SIZE];
 extern long long cfs_tracefile_size;
 
 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.
  */
 /**
  * The path of debug log dump upcall script.
  */
index c2a420d..ee91020 100644 (file)
@@ -180,15 +180,10 @@ static int expired_lock_main(void *arg)
 
                spin_lock_bh(&waiting_locks_spinlock);
                if (expired_lock_thread.elt_dump) {
 
                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();
                        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;
 
                        spin_lock_bh(&waiting_locks_spinlock);
                        expired_lock_thread.elt_dump = 0;