Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1881112rdb; Sun, 19 Nov 2023 14:47:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+Fyw5V+hJ59BglezFRiFmKQ84scavFi4Cw3pVSjB/fPIV12XZ/2CNtD0UaF5/lY7EDihT X-Received: by 2002:a05:6808:128d:b0:3b5:37c6:6dcb with SMTP id a13-20020a056808128d00b003b537c66dcbmr9074256oiw.21.1700434045822; Sun, 19 Nov 2023 14:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700434045; cv=none; d=google.com; s=arc-20160816; b=lb+b58sC/ysu58ADe3+BiZGVBy/lwPVHKPk8NlXsduMw7zL3VhTC2DYtBDbv25LvWe FGkFivK1b7uTioLVG9GK/PpiIqIckAdf/p7vMRHxWhkBvwZzlwoCiODGyMYgCzN+9paZ 9FdjTFFWiJSDpMUKqXMZgTvIh4jbFlOrLHpUldaoa/V7+OcRSIbHvvdEV6t6Imi1/y4O Bx46kus5efnfYRxDyLiIA8eRYtfu2hn7RQgKSisuTnTft81HtCn51jvibWnMftVnl0xg d/PiY+fcM7WIs9QNtOdjlokYK8O/XVyAptCrw3noewMngH0CefNQbtesdz77b5MRToCO 5ySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=xmMI49vYUpW7GVnOnFaREy3ONietvbBmNKkKdxBAE/w=; fh=3cVUqrBlCYKHDH/sVHASgoDP1h1US1q68V5dOsonqkA=; b=kSjDtrYvwKXogMGjUTdSlO1LqsGu4tP9G/67f1Bog+S4Ey060sGo3u1AXUq2IMlt2b IP9u6w4l7xReA2vZQILnq2zZSd8Z2YOZ6616NaDN2Ww2ensQxG5KOOBagkPeqsw4ozRO kxcmIZlIogtF0Q22R2b98HDVrnFFOzeZRrq9vpxUJAWDG3bmmcnwYuVzP2PJZFM2YMdt q0ap45BiSHfOP+f5U31WFSkJrL0YqtF/qq569W2VYGmA+TdxPeAxJ58QeQLYxfnPPMoj k2u18jHl0Y8sNkrteP64SAdJ3BDhqLJyueZFRcpIKCUOYtoGrzw1zrGEFge6XokeQdIH 1GTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=P5d3sBK+; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id j14-20020a056a00130e00b0068a54522bb0si7085470pfu.144.2023.11.19.14.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 14:47:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=P5d3sBK+; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E41C98085991; Sun, 19 Nov 2023 14:47:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjKSWrO (ORCPT + 99 others); Sun, 19 Nov 2023 17:47:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjKSWrO (ORCPT ); Sun, 19 Nov 2023 17:47:14 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C419E for ; Sun, 19 Nov 2023 14:47:10 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3A8BF1F750; Sun, 19 Nov 2023 22:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1700434029; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xmMI49vYUpW7GVnOnFaREy3ONietvbBmNKkKdxBAE/w=; b=P5d3sBK+84HhJKRpYBDR0qYCVXlCBL+Sadyu9ZNMjyoCB9BpgQVnIDfSUrNJlZ4PBGM9L7 LFTAnzRBtOPzbeXMUhbxA2kyiRuTrYPlWmi+S3VzRzFG0EnNAwv3lCK5wGiAnCA2i12dwv T6aR3tDTK9B+6imqPE3daGvnPl+qBX0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1700434029; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xmMI49vYUpW7GVnOnFaREy3ONietvbBmNKkKdxBAE/w=; b=iThOwzauWpfPsQfjw9iS+OEiO+91XDA23MRpRV1fe0hoiBdtb028ClXNgxlp75v4U8dR6g oJwCbLVzu+0eZxCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 120831377F; Sun, 19 Nov 2023 22:47:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id U1O9LWqQWmWcYwAAMHmgww (envelope-from ); Sun, 19 Nov 2023 22:47:06 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: "Jeff Layton" , linux-nfs@vger.kernel.org, "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" Subject: Re: [PATCH 6/9] nfsd: allow admin-revoked NFSv4.0 state to be freed. In-reply-to: References: <20231117022121.23310-1-neilb@suse.de>, <20231117022121.23310-7-neilb@suse.de>, Date: Mon, 20 Nov 2023 09:47:03 +1100 Message-id: <170043402394.19300.7144468429486716541@noble.neil.brown.name> Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 6.40 X-Spamd-Result: default: False [6.40 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(3.00)[0.999]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_SPAM_LONG(3.50)[1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[28.25%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 19 Nov 2023 14:47:23 -0800 (PST) On Sat, 18 Nov 2023, Chuck Lever wrote: > On Fri, Nov 17, 2023 at 01:18:52PM +1100, NeilBrown wrote: > > For NFSv4.1 and later the client easily discovers if there is any > > admin-revoked state and will then find and explicitly free it. > > > > For NFSv4.0 there is no such mechanism. The client can only find that > > state is admin-revoked if it tries to use that state, and there is no > > way for it to explicitly free the state. So the server must hold on to > > the stateid (at least) for an indefinite amount of time. A > > RELEASE_LOCKOWNER request might justify forgetting some of these > > stateids, as would the whole clients lease lapsing, but these are not > > reliable. > > > > This patch takes two approaches. > > > > Whenever a client uses an revoked stateid, that stateid is then > > discarded and will not be recognised again. This might confuse a client > > which expect to get NFS4ERR_ADMIN_REVOKED consistently once it get it at > > all, but should mostly work. Hopefully one error will lead to other > > resources being closed (e.g. process exits), which will result in more > > stateid being freed when a CLOSE attempt gets NFS4ERR_ADMIN_REVOKED. > > > > Also, any admin-revoked stateids that have been that way for more than > > one lease time are periodically revoke. > > > > No actual freeing of state happens in this patch. That will come in > > future patches which handle the different sorts of revoked state. > > > > Signed-off-by: NeilBrown > > --- > > fs/nfsd/netns.h | 4 ++ > > fs/nfsd/nfs4state.c | 97 ++++++++++++++++++++++++++++++++++++++++++++- > > 2 files changed, 100 insertions(+), 1 deletion(-) > > > > diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h > > index ec49b200b797..02f8fa095b0f 100644 > > --- a/fs/nfsd/netns.h > > +++ b/fs/nfsd/netns.h > > @@ -197,6 +197,10 @@ struct nfsd_net { > > atomic_t nfsd_courtesy_clients; > > struct shrinker nfsd_client_shrinker; > > struct work_struct nfsd_shrinker_work; > > + > > + /* last time an admin-revoke happened for NFSv4.0 */ > > + time64_t nfs40_last_revoke; > > + > > }; > > This hunk doesn't apply to nfsd-next due to v6.7-rc changes to NFSD > to implement a dynamic shrinker. So I stopped my review here for > now. I didn't a rebase onto nfsd-next and there were no conflicts! I guess the change from struct work_struct nfsd_shrinker_work; to struct work_struct *nfsd_shrinker_work; was technically a conflict but I'm surprised your tool complained.. NeilBrown