Received: by 10.223.185.116 with SMTP id b49csp8022182wrg; Thu, 1 Mar 2018 15:38:22 -0800 (PST) X-Google-Smtp-Source: AG47ELtBx1+swm7nOgq1movTXnoHcEIjLtkwQCtTVXIIjiUMAZpb3E8AtaxBiLZFtBKB1+H4SY2C X-Received: by 10.99.53.193 with SMTP id c184mr2884501pga.180.1519947502370; Thu, 01 Mar 2018 15:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519947502; cv=none; d=google.com; s=arc-20160816; b=j3Ge6f+ZX+0zyC/lS77skgOoKdNomxESOjQMKtC5tWcscNNV/LbS3eojdtiQsZSaei MPXSSLpTXn0fOe/fptUC5f+vzxaRPfs2QlBKon+QGV9wrBTxFovZMh9Jdz7SP4QPgmiW nP3JRX2EzvsjSdojnTxJqfjfmH0UhfKM72IKz885ihhvzULqyiVC+7UBnDkhksInB3cv B8EnhiagYUZxSOzKpBq+f9dQvbjkXB+59HvWbV82U4uLC+2S9hEOsegWm7YOxemEs01H +Srr+pXohLk2t0PnMyxJ9W+4comuW215myx0wv7F/ILALJoHhnlreBAUKxGyB/5JjPMh KdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from:arc-authentication-results; bh=jHOSYWaeNyqXdGPinYF2SUJ3PQ3PezIxJ9oxpwU2sOQ=; b=Vf2Ervc8vsDAcaLNXyUuecPKgVH0SRd4Aa72H/lYxj0lFOhSCrrVs2nBRPYLBF1Z6L LFOToi02lH7QYWecC4c0kDwlQBkltgR4HkF4lZfbMIszDIOeZHX8cha15jUMA4mg2/PP YYoFEl/TlYNbt1IPmNhRzTnD12ZtLP8pNalm0Ukx5TAGV73KfdnXaheedZyT9lNJFFva R92A99CGAfmngC8gSidTA/oQq2+wOe4nR0ezca/aewxDiCpepKrVjNoqUxmdI0dq2Law 90VNfON8tHw2xLgB0DgLn0d7C1ychSawtbNxRgBhqmVBcx2FikenwreZ7aVldhFTFKXo v25g== 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 s190si2987150pgc.510.2018.03.01.15.38.07; Thu, 01 Mar 2018 15:38:22 -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 S1163247AbeCAXcp (ORCPT + 99 others); Thu, 1 Mar 2018 18:32:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:54130 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163149AbeCAXcm (ORCPT ); Thu, 1 Mar 2018 18:32:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8BB7CB46C; Thu, 1 Mar 2018 23:32:41 +0000 (UTC) From: NeilBrown To: Oleg Drokin , Greg Kroah-Hartman , James Simmons , Andreas Dilger Date: Fri, 02 Mar 2018 10:31:25 +1100 Subject: [PATCH 04/17] staging: lustre: obdclass: don't require lct_owner to be non-NULL. Cc: Linux Kernel Mailing List , Lustre Development List Message-ID: <151994708517.7628.10169180583984336095.stgit@noble> In-Reply-To: <151994679573.7628.1024109499321778846.stgit@noble> References: <151994679573.7628.1024109499321778846.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 */