Whamcloud - gitweb
LU-9859 libcfs: don't save journal_info in dumplog thread. 94/39294/4
authorMr NeilBrown <neilb@suse.de>
Mon, 6 Jul 2020 12:34:44 +0000 (08:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Aug 2020 06:04:02 +0000 (06:04 +0000)
As this thread is started by kthread, it must have
a clean environment and cannot possibly be in a
filesystem transaction.  So current->journal_info
must be NULL, and preserving it serves no purpose.

Also change libcfs_debug_dumplog_internal() to 'static'
to make it clear that it shouldn't be called from
anywhere but this thread.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie863f792b36792600bef4fe778c46e97ebf046c3
Reviewed-on: https://review.whamcloud.com/39294
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c
libcfs/libcfs/tracefile.h

index 09e3db7..c45ef08 100644 (file)
@@ -395,14 +395,11 @@ static void libcfs_run_debug_log_upcall(char *file)
 /**
  * Dump Lustre log to ::debug_file_path by calling tracefile_dump_all_pages()
  */
-void libcfs_debug_dumplog_internal(void *arg)
+static void libcfs_debug_dumplog_internal(void *arg)
 {
        static time64_t last_dump_time;
        time64_t current_time;
-       void *journal_info;
 
-       journal_info = current->journal_info;
-       current->journal_info = NULL;
        current_time = ktime_get_real_seconds();
 
        if (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0 &&
@@ -415,8 +412,6 @@ void libcfs_debug_dumplog_internal(void *arg)
                cfs_tracefile_dump_all_pages(debug_file_name);
                libcfs_run_debug_log_upcall(debug_file_name);
        }
-
-       current->journal_info = journal_info;
 }
 
 static int libcfs_debug_dumplog_thread(void *arg)
index 0ab2aec..8413413 100644 (file)
@@ -65,7 +65,6 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob);
 int cfs_trace_set_debug_mb(int mb);
 int cfs_trace_get_debug_mb(void);
 
-extern void libcfs_debug_dumplog_internal(void *arg);
 extern int  libcfs_panic_in_progress;
 
 #define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT))