Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp240088rwj; Thu, 22 Dec 2022 07:12:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXu2U2sOLrx/fg0bcNsa+tyeMdn1Z3HH4mxxocSNNbC3X6iL2RV2gvs/itx0r05HbFlmSoqX X-Received: by 2002:a62:f248:0:b0:576:1cb3:7981 with SMTP id y8-20020a62f248000000b005761cb37981mr6185489pfl.32.1671721966629; Thu, 22 Dec 2022 07:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671721966; cv=none; d=google.com; s=arc-20160816; b=dXx22o0drQf6UTZK9vMrinV5sTKXkrByz4itXH7MVsT8WzcdV6+DjgvCUnvz/T7+bC 0PszKU9RhXgmdJJZ9AEJ4gZEZm+b3/ZD/Yrra2V7pxT4TxboDXc2lvErm7lTpBuwv2Fh cqr4pg30pCdc2mLwmaWOx39mqFUecfiXgoKBzpWFQjChG5lJszu1vgtwrpdf+xmwCRrc dTFMNd0ZMwMXgplmy2Ucjg/ygg7+91BuelXyssROKJL2w+nISuUQJDuRiZ7n+HvRpJAZ hgAXanHctw4c/HjEm6HOXIcYszun4dRgvmMLrpL2ZtIuZY1AjSfH65wUst4fvxAyttrC oNFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=GHlJxV8lqn6eRBNCVskwgIdYnFeALUywK5KMoqIe/1I=; b=J7qQnOVg5DEZZue2BFpxZFjb2qKz487SMuJGCiOdNT7pZUF2tBd4mxv7+4aR197NVT fdPB0jx3p8rz27Qg7UJa2JDo0U64cLz5nGN1RSt0uhEynZaDewaDpBi2nMki/36/Kumu Xt5OLGA4ItQULFSiyJ4CmBHhW3seKOJGAB7eYzOJ4dWYUe/YfmrE6Hy1SaJQpSOwO4mW RkOPa6dmCM5WZv4fz4jWAOwG3Kdc3SQEFBWRMuWof3Q5nMO20uILF0LKcfKAIwGISx/W VJyGpA5mLbKPNvEi8Zf2jxCByuVTaYHEK4CrWPIefb6f/YNx4lDAOy3czq8Jyi263yl1 nfrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Lv6k8/Gs"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020aa79215000000b0052ee88f59c4si793751pfo.372.2022.12.22.07.12.32; Thu, 22 Dec 2022 07:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Lv6k8/Gs"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229763AbiLVPLm (ORCPT + 99 others); Thu, 22 Dec 2022 10:11:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235855AbiLVPLS (ORCPT ); Thu, 22 Dec 2022 10:11:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA5713FAC for ; Thu, 22 Dec 2022 07:10:10 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7DC8361C27 for ; Thu, 22 Dec 2022 15:10:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80BF8C433D2; Thu, 22 Dec 2022 15:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671721809; bh=kFokKpYHK5p4eNpyBgxQhNpG5w8jDGT8Ujr9tyMaQxw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Lv6k8/Gsxbrb5RaJaA2OxSTTLM1JdT2zqCsFkrPGwKRN91ukrbc593atKN0bPVins b/gQtga/uSfVRKlPb7Sy6mAO84KXS1nByXgOIFuprdxuAx0CtZGMA1w7D6FMJgVfs6 geUgYaycizHNwrG7b4hoo00Q0S4rhkNYtJCHury0UViX/U60L848TRrKjES61P8ldD c+T0DstDISTheLMPqg97MOgjL8iuns4sbXL2YiGGxCNMJugI+ZKp1NPxGqTIymNVJD v/neO8wipSda4LbRDO/ZKCGd5Y72Yy7KFNSK5OgNn5eQzv+KluwlFsWFiHiiYDS8ua 4RcLPPtSnXqvw== Message-ID: <46416c9d66e5c64feb3093d3f1f6b6248d49467b.camel@kernel.org> Subject: Re: [PATCH] nfsd: shut down the NFSv4 state objects before the filecache From: Jeff Layton To: Chuck Lever III Cc: Linux NFS Mailing List , Wang Yugui Date: Thu, 22 Dec 2022 10:10:08 -0500 In-Reply-To: <3858C5C1-342C-4599-A1B5-BF55953D0CBB@oracle.com> References: <20221222145130.162341-1-jlayton@kernel.org> <3858C5C1-342C-4599-A1B5-BF55953D0CBB@oracle.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.2 (3.46.2-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, 2022-12-22 at 14:55 +0000, Chuck Lever III wrote: >=20 > > On Dec 22, 2022, at 9:51 AM, Jeff Layton wrote: > >=20 > > Currently, we shut down the filecache before trying to clean up the > > stateids that depend on it. This leads to the kernel trying to free an > > nfsd_file twice, and a refcount overput on the nf_mark. > >=20 > > Change the shutdown procedure to tear down all of the stateids prior > > to shutting down the filecache. > >=20 > > Reported-and-Tested-by: Wang Yugui > > Signed-off-by: Jeff Layton > > --- > > fs/nfsd/nfssvc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c > > index 56fba1cba3af..325d3d3f1211 100644 > > --- a/fs/nfsd/nfssvc.c > > +++ b/fs/nfsd/nfssvc.c > > @@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net) > > { > > struct nfsd_net *nn =3D net_generic(net, nfsd_net_id); > >=20 > > - nfsd_file_cache_shutdown_net(net); > > nfs4_state_shutdown_net(net); > > + nfsd_file_cache_shutdown_net(net); > > if (nn->lockd_up) { > > lockd_down(net); > > nn->lockd_up =3D false; > > --=20 > > 2.38.1 > >=20 >=20 > Hi Jeff, seems sensible. May I add: >=20 > Fixes: 5e113224c17e ("nfsd: nfsd_file cache entries should be per net nam= espace") >=20 Yes, thanks. --=20 Jeff Layton