From patchwork Tue Oct 6 00:05:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11817903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3EA71580 for ; Tue, 6 Oct 2020 00:07:00 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DD24206F4 for ; Tue, 6 Oct 2020 00:07:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DD24206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 0AE4A2F5AA4; Mon, 5 Oct 2020 17:06:48 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id B7C5821F904 for ; Mon, 5 Oct 2020 17:06:29 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 1050E10087D1; Mon, 5 Oct 2020 20:06:25 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 07B412CC30; Mon, 5 Oct 2020 20:06:25 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 5 Oct 2020 20:05:48 -0400 Message-Id: <1601942781-24950-10-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601942781-24950-1-git-send-email-jsimmons@infradead.org> References: <1601942781-24950-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 09/42] lnet: libcfs: don't save journal_info in dumplog thread. X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Mr NeilBrown 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. WC-bug-id: https://jira.whamcloud.com/browse/LU-9859 Lustre-commit: 2eba3f9c3de50 ("LU-9859 libcfs: don't save journal_info in dumplog thread.") Signed-off-by: Mr NeilBrown Reviewed-on: https://review.whamcloud.com/39294 Reviewed-by: James Simmons Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/libcfs/debug.c | 7 +------ net/lnet/libcfs/tracefile.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/net/lnet/libcfs/debug.c b/net/lnet/libcfs/debug.c index dd03520..ba32a99 100644 --- a/net/lnet/libcfs/debug.c +++ b/net/lnet/libcfs/debug.c @@ -372,14 +372,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) && @@ -392,8 +389,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) diff --git a/net/lnet/libcfs/tracefile.h b/net/lnet/libcfs/tracefile.h index 88ff0d1..5b90c1b 100644 --- a/net/lnet/libcfs/tracefile.h +++ b/net/lnet/libcfs/tracefile.h @@ -69,7 +69,6 @@ int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, int cfs_trace_set_debug_mb(int mb); int cfs_trace_get_debug_mb(void); -void libcfs_debug_dumplog_internal(void *arg); extern int libcfs_panic_in_progress; #define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT))