Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1844146pxb; Mon, 13 Sep 2021 06:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweI+fG8neEOJwU01jNm5UWtTo2095vYy6Josg8QflnXCYi7g+z7kWjGCxQs+PiZog9lrUn X-Received: by 2002:a05:6e02:17cf:: with SMTP id z15mr7608225ilu.103.1631540839844; Mon, 13 Sep 2021 06:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540839; cv=none; d=google.com; s=arc-20160816; b=e8T8W5L7C0RQyW+F4v2kfqdUN5PanA89qf4j+HGG2YIjOdxxL0zTlocNj2ZQR6zxgl 8onH98bAKs6xEA3q07v0PBniKG28U9biRaBiUjZEtJF89w5+k3DANWZZ/dQ7IfO77nqw He5Q1NHrEDZKK1uhmd5AfGAnHcLyX0bqmYSk8X+T3SwKYbm5N5fY95vrxojJ2bV4cs4c qVT36UTNZoQAPqINa63YDJ0xuwMZrY+1PAfxfWGIo85XfruJmLnLQI9AZLv88fLiaNOo SflIauTiw2LX//d4IIL64q/NL/EZIgT+Sm2gqAy0imOkpdfKX0oc0wI01mT01Pq8moBz IllA== 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=DByZJ0VIUeP+ry3BKm3NDHGTaMAQOsDhH8YiGuNgk/g=; b=SeIeBGu1tJaz48TPHa/nnlPl5fr035RI39boesAEb39qNo4GUS0m/IApsVzbrnBpEj pXc7LogqWmHVTsVHmJ2Nxuny2CPp585GpUv5unYdhvh+BmFmPfQE474Z9TcyA0NhkFv+ HSYrX0m0CLD2JfY1sSs4/iYWP9+Epnwgce2kmVZvA2VpMwUUEH1bN1I5gYxZj4agOQuo 3NDvO/VoRTR4LTjHYEamGPeZtZkVhdluj9VfEU7sueXugJhxwByTJsfcnZUWjfH/OXf1 yhWJvL7EZOVkxgJCavejs/OcKWovUykzLO6eAquqJzyj9yJb+IOeGSkm9Xt7F82YNnKy ib8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vr853Zg0; 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 b3si6991210iot.102.2021.09.13.06.47.07; Mon, 13 Sep 2021 06:47:19 -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=vr853Zg0; 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 S242948AbhIMNrN (ORCPT + 99 others); Mon, 13 Sep 2021 09:47:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243173AbhIMNmD (ORCPT ); Mon, 13 Sep 2021 09:42:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 59A3A61409; Mon, 13 Sep 2021 13:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539804; bh=rgDUh1MOK9zHmoxEWJmcgdk9UcoBZzxp9Kao/q7MEm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vr853Zg04X8KX5c0/JKM76I6OOMPE9Pa7ypzyXwMpTSlprqoBz/wKsf3YLxNX9P+m gP9qIcE5FcwybbOlpJaNLi6eV+MSyfx53A9rzUq86B/SXHcmadE1qmEdntKCHMn+RR 8eOyO9UgSb5KZUjGykOPJ4oqEBnjrpXtukMnW+hA= 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.10 166/236] nfsd4: Fix forced-expiry locking Date: Mon, 13 Sep 2021 15:14:31 +0200 Message-Id: <20210913131106.020822412@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 80e394a2e3fd..142aac9b63a8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2646,9 +2646,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