Received: by 10.223.185.116 with SMTP id b49csp5517175wrg; Wed, 7 Mar 2018 13:11:32 -0800 (PST) X-Google-Smtp-Source: AG47ELvntA95PvpllCVRYuAkXtu6PzrLn6sLiO1xIAWD4h2zeJTFNlT3eAngf4t/5wAJwcIR9o3d X-Received: by 10.98.72.10 with SMTP id v10mr23799324pfa.148.1520457092726; Wed, 07 Mar 2018 13:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520457092; cv=none; d=google.com; s=arc-20160816; b=jHcM7IdIRINN72N0OTLPaL4xq21sckmTrAGtS54YwUuJuN5SllX/vTqHjcvqmjD/8W v2cwwmrK1GUA5XGIfpNpLf3LTOomBga+vk/yK86tcafk6ZrWaAvVjAtHfOz1kNJUO5iG WfW7f87N06vGkWYnqi857uDP2UzMvk9rshm0Bxlt0cgouH+23SgrlB36unmCtQs7YZma rHQLXtuF/hZA0oVjjGT1RPZmUioydiRuRMTXJC5wTcsuHnV137XaxLgOIY4wNqc4MJ9Y mPw9fF+02P9SMTaua6bkHC0t+DsbyWBx6KP9rgaHN9+w7dIw6rzScxtMujAVRrHoRXuy xdqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=ZpqFeK4FCYnYWO8vvjHFw25BT7aYEqnhzSOU9SiMOdo=; b=qI8dFcF+XiWzK6Cum4dgvnjppA7KwQbWOXt+zH4GpLdm9Wj94YspU1uSJtlloMz/OM Erz7PSA35IdhPGc3qNZ9xKISZKP3n2AQKpgmo5GPV55VvyPMf3oVWwTm+3kgozslMgS7 F6+2gPiuH8jWUN+kcHVOlSFOCkzYLwHZMGtIZXpVs8a1tpTKOvT5+jIpOuuJU791iv5E 63XwJttZUAVnaP+C+2xEB5q1Qn9omvPghUZJY8KtpuR9xKReBz+Xcyam4eAEeX95P2Nn 4wzJndn2r2l2aEX2Ib9kZYJpZw3flENMDUzG8ileFifVJMJq8hbZ4sEv0oGVHY9t9MDn qmFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si11834748pgv.672.2018.03.07.13.11.17; Wed, 07 Mar 2018 13:11:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754771AbeCGVKT convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Mar 2018 16:10:19 -0500 Received: from mga02.intel.com ([134.134.136.20]:5206 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754544AbeCGVKS (ORCPT ); Wed, 7 Mar 2018 16:10:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 13:10:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,437,1515484800"; d="scan'208";a="209668885" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 07 Mar 2018 13:10:17 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 7 Mar 2018 13:10:17 -0800 Received: from FMSMSX109.amr.corp.intel.com ([169.254.15.144]) by fmsmsx121.amr.corp.intel.com ([169.254.6.69]) with mapi id 14.03.0319.002; Wed, 7 Mar 2018 13:10:17 -0800 From: "Dilger, Andreas" To: NeilBrown CC: "Drokin, Oleg" , Greg Kroah-Hartman , James Simmons , "Linux Kernel Mailing List" , Lustre Development List Subject: Re: [PATCH 04/17] staging: lustre: obdclass: don't require lct_owner to be non-NULL. Thread-Topic: [PATCH 04/17] staging: lustre: obdclass: don't require lct_owner to be non-NULL. Thread-Index: AQHTsbWZEU9W0VVzmkufKJTNHAVNgKPF1BGA Date: Wed, 7 Mar 2018 21:10:16 +0000 Message-ID: <09E84FB8-BF65-4D08-BAB1-8C2AEC85B3B2@intel.com> References: <151994679573.7628.1024109499321778846.stgit@noble> <151994708517.7628.10169180583984336095.stgit@noble> In-Reply-To: <151994708517.7628.10169180583984336095.stgit@noble> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.6.233] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 1, 2018, at 16:31, NeilBrown wrote: > > Some places in lu_object.c allow lct_owner to be NULL, implying > that the code is built in to the kernel (not a module), but > two places don't. This prevents us from building lustre into > the kernel. > > So remove the requirement and always allow lct_owner to be NULL. > > This requires removing an "assert" that the module count is positive, > but this is redundant as module_put() already does the necessary test. > > Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger > --- > drivers/staging/lustre/lustre/obdclass/lu_object.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c > index cca688175d2d..880800e78c52 100644 > --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c > +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c > @@ -1380,12 +1380,8 @@ static void key_fini(struct lu_context *ctx, int index) > lu_ref_del(&key->lct_reference, "ctx", ctx); > atomic_dec(&key->lct_used); > > - if ((ctx->lc_tags & LCT_NOREF) == 0) { > -#ifdef CONFIG_MODULE_UNLOAD > - LINVRNT(module_refcount(key->lct_owner) > 0); > -#endif > + if ((ctx->lc_tags & LCT_NOREF) == 0) > module_put(key->lct_owner); > - } > ctx->lc_value[index] = NULL; > } > } > @@ -1619,7 +1615,6 @@ static int keys_fill(struct lu_context *ctx) > LINVRNT(key->lct_init); > LINVRNT(key->lct_index == i); > > - LASSERT(key->lct_owner); > if (!(ctx->lc_tags & LCT_NOREF) && > !try_module_get(key->lct_owner)) { > /* module is unloading, skip this key */ > > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation