From patchwork Mon Sep 30 18:55:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11167193 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 0CF98912 for ; Mon, 30 Sep 2019 19:02:40 +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 E9B3D224F0 for ; Mon, 30 Sep 2019 19:02:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9B3D224F0 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 343C75E44C7; Mon, 30 Sep 2019 11:59:25 -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 06C0D5C3B47 for ; Mon, 30 Sep 2019 11:57:25 -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 355D010058F8; Mon, 30 Sep 2019 14:56:57 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 330FEB5; Mon, 30 Sep 2019 14:56:57 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 30 Sep 2019 14:55:42 -0400 Message-Id: <1569869810-23848-84-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> References: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 083/151] lustre: obd: free obd_svc_stats when all users are gone 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: Bruno Faccini During object device shutdown obd_svc_stats must only be freed after all access methods from user-land are no longer possible to prevent any race and further crash. WC-bug-id: https://jira.whamcloud.com/browse/LU-10224 Lustre-commit: ffc843a0aacd (LU-10224 obd: free obd_svc_stats when all users are gone") Signed-off-by: Bruno Faccini Reviewed-on: https://review.whamcloud.com/30249 Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/mdc/mdc_request.c | 1 - fs/lustre/osc/osc_request.c | 1 - fs/lustre/ptlrpc/lproc_ptlrpc.c | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c index 9bae3a5..1a0f05a 100644 --- a/fs/lustre/mdc/mdc_request.c +++ b/fs/lustre/mdc/mdc_request.c @@ -2584,7 +2584,6 @@ static int mdc_precleanup(struct obd_device *obd) obd_cleanup_client_import(obd); ptlrpc_lprocfs_unregister_obd(obd); - lprocfs_obd_cleanup(obd); ldebugfs_free_md_stats(obd); mdc_llog_finish(obd); return 0; diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c index 5581f42..2dce087 100644 --- a/fs/lustre/osc/osc_request.c +++ b/fs/lustre/osc/osc_request.c @@ -3070,7 +3070,6 @@ static int osc_precleanup(struct obd_device *obd) osc_precleanup_common(obd); ptlrpc_lprocfs_unregister_obd(obd); - lprocfs_obd_cleanup(obd); return 0; } diff --git a/fs/lustre/ptlrpc/lproc_ptlrpc.c b/fs/lustre/ptlrpc/lproc_ptlrpc.c index 6ce4d9e..02713076 100644 --- a/fs/lustre/ptlrpc/lproc_ptlrpc.c +++ b/fs/lustre/ptlrpc/lproc_ptlrpc.c @@ -1172,6 +1172,10 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc) void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) { + /* cleanup first to allow concurrent access to device's + * stats via debugfs to complete safely + */ + lprocfs_obd_cleanup(obd); debugfs_remove_recursive(obd->obd_svc_debugfs_entry); if (obd->obd_svc_stats)