From patchwork Thu Mar 14 00:11:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10852007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45E2317DF for ; Thu, 14 Mar 2019 00:15:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA6C2884E for ; Thu, 14 Mar 2019 00:15:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23E9E2A06B; Thu, 14 Mar 2019 00:15:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE0922884E for ; Thu, 14 Mar 2019 00:15:48 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 8702872019E; Wed, 13 Mar 2019 17:15:48 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 3FFCD72006A for ; Wed, 13 Mar 2019 17:15:46 -0700 (PDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6D73CAF5F; Thu, 14 Mar 2019 00:15:45 +0000 (UTC) From: NeilBrown To: Andreas Dilger , James Simmons , Oleg Drokin Date: Thu, 14 Mar 2019 11:11:51 +1100 Message-ID: <155252231148.26912.899667623955916563.stgit@noble.brown> In-Reply-To: <155252182126.26912.1842463462595601611.stgit@noble.brown> References: <155252182126.26912.1842463462595601611.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 27/32] lustre: don't call unshare_fs_struct() 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 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP A kthread runs with the same fs_struct as init. It is only helpful to unshare this if the thread will change one of the fields in the fs_struct: root directory current working directory umask. No lustre kthread changes any of these, so there is no need to call unshare_fs_struct(). Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/obdclass/llog.c | 3 --- drivers/staging/lustre/lustre/ptlrpc/import.c | 3 --- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 2 -- drivers/staging/lustre/lustre/ptlrpc/service.c | 4 ---- 4 files changed, 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index a34b1a7108b7..ebb6c03ef038 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -45,7 +45,6 @@ #define DEBUG_SUBSYSTEM S_LOG #include -#include #include #include #include @@ -399,8 +398,6 @@ static int llog_process_thread_daemonize(void *arg) struct lu_env env; int rc; - unshare_fs_struct(); - /* client env has no keys, tags is just 0 */ rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD); if (rc) diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 26a976865fbd..b2a57d2bdde7 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -38,7 +38,6 @@ #define DEBUG_SUBSYSTEM S_RPC #include -#include #include #include #include @@ -1328,8 +1327,6 @@ static int ptlrpc_invalidate_import_thread(void *data) { struct obd_import *imp = data; - unshare_fs_struct(); - CDEBUG(D_HA, "thread invalidate import %s to %s@%s\n", imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid); diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index c295e9943bf7..b02e6c50bae1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -53,7 +53,6 @@ #define DEBUG_SUBSYSTEM S_RPC #include -#include #include #include #include @@ -389,7 +388,6 @@ static int ptlrpcd(void *arg) int rc = 0; int exit = 0; - unshare_fs_struct(); if (cfs_cpt_bind(cfs_cpt_tab, pc->pc_cpt) != 0) CWARN("Failed to bind %s on CPT %d\n", pc->pc_name, pc->pc_cpt); diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index c6b95c721167..571f0455e7b0 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -34,7 +34,6 @@ #define DEBUG_SUBSYSTEM S_RPC #include -#include #include #include #include @@ -2029,7 +2028,6 @@ static int ptlrpc_main(void *arg) int counter = 0, rc = 0; thread->t_pid = current->pid; - unshare_fs_struct(); /* NB: we will call cfs_cpt_bind() for all threads, because we * might want to run lustre server only on a subset of system CPUs, @@ -2230,8 +2228,6 @@ static int ptlrpc_hr_main(void *arg) LIST_HEAD(replies); int rc; - unshare_fs_struct(); - rc = cfs_cpt_bind(ptlrpc_hr.hr_cpt_table, hrp->hrp_cpt); if (rc != 0) { char threadname[20];