Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1828193pxb; Mon, 13 Sep 2021 06:27:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa32TibKm9G2RuVtaZ+/jcNmpTGlwsfz8CW7r1Fy4xN68S7imBhzJ91+yGzDQFRCA/lRHk X-Received: by 2002:a05:6602:2e13:: with SMTP id o19mr9112738iow.9.1631539664911; Mon, 13 Sep 2021 06:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539664; cv=none; d=google.com; s=arc-20160816; b=nwPCVI/DEccESDOgIZWzqUjBRJlFUSsBAYh4cBYWzyfzXlZ6X+j6RM7trV52XRP62M stg76qdc3Hc9oBtzbMwgh5O6WxEBusRJLJyKrjZBg1mboUyHIsGbhZp+UUAQUvu5GwqW pM66gEKmJRyI7YXaQBTgZJ0r9XV8cawK3v40hQtXwaJqReXS0PtU70eRhdQnr12ogUWA tdLiTXty/edOSxhH/6Eb0BgJKyslMyoFn/U30gUlkBe8iDyzxNJPgRmr3SKaoDKurxyP yr8RMXx8yHxtVBENUnrH2UfI4MKHRyRQZEtyyajaugkkSg0D1Qu4L8YlWLityQugUGMN 2dhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qGqmtDML3aH0ZqoNTJHQJQidC5BCBcyxNJF+P6TL8n4=; b=kLgek3dU7fsheFlwM7En2neA5bPm15shom/MSf9VTCIROWBpfKKQtNXMuyFSPPUTAy fJJlMARXezqIc+Pp47CEwEm/rectRF/cOnKuB8jNOrbtX81DDmXv1guReI+/k54xkkFf a+5z/B2YqZOyg6TwpLGQ3ChgwLmP1yhGN0srsw5Ywx4VA/Q6k7ysiObsSgSbbTUayNMu JB7ErbYUzG9Xpz7OtUgk2faqrT5nlk/INX8V+/fqYnaKhhxbKrXPTMJ7CyJ1ioIdzZtS nOKmrworuF6k7TOpiFVsdhOqRo3uab2KNkdSFSHZbe+Drn6kWTntiNkHwuM75sb26mGJ aoJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xsyJmpq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si3774861ios.63.2021.09.13.06.27.33; Mon, 13 Sep 2021 06:27:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xsyJmpq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241115AbhIMN1S (ORCPT + 99 others); Mon, 13 Sep 2021 09:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241026AbhIMNZF (ORCPT ); Mon, 13 Sep 2021 09:25:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82C2261222; Mon, 13 Sep 2021 13:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539333; bh=i+kTwWeRz7kfRiEgvV5KQKdENgGUddvRRtRuMywMqws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsyJmpq2qO4a8NXhNMfv/PBEW/1+Sj+Iau/K+eVf5dZJzW5d3zpybbWa2EMd+0Oa0 myP2rAg2WDXWc487G3OqzyoqFaBzoLxuQ1WY3Yydp4Fgh4RqAxeisYsh0X0omKPMuY 7KL6w1OHE/p88vk5nVVGNtAR44g9NPbPASKCf6ec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "J. Bruce Fields" , Chuck Lever , Sasha Levin Subject: [PATCH 5.4 097/144] nfsd4: Fix forced-expiry locking Date: Mon, 13 Sep 2021 15:14:38 +0200 Message-Id: <20210913131051.186326934@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: J. Bruce Fields [ Upstream commit f7104cc1a9159cd0d3e8526cb638ae0301de4b61 ] This should use the network-namespace-wide client_lock, not the per-client cl_lock. You shouldn't see any bugs unless you're actually using the forced-expiry interface introduced by 89c905beccbb. Fixes: 89c905beccbb "nfsd: allow forced expiration of NFSv4 clients" Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/nfsd/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8cb2f744dde6..3283cc2a4e42 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2572,9 +2572,9 @@ static void force_expire_client(struct nfs4_client *clp) struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); bool already_expired; - spin_lock(&clp->cl_lock); + spin_lock(&nn->client_lock); clp->cl_time = 0; - spin_unlock(&clp->cl_lock); + spin_unlock(&nn->client_lock); wait_event(expiry_wq, atomic_read(&clp->cl_rpc_users) == 0); spin_lock(&nn->client_lock); -- 2.30.2