Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp721361qtx; Mon, 31 Oct 2022 12:14:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DGRJUW+Dq/XTyfYUMalixh8BWyvL9nCgJuY9eJzI+Ao3kyJLUAlARpS9NWwYff1OvP/vX X-Received: by 2002:a17:907:6e11:b0:78e:3057:f631 with SMTP id sd17-20020a1709076e1100b0078e3057f631mr13896910ejc.333.1667243641781; Mon, 31 Oct 2022 12:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667243641; cv=none; d=google.com; s=arc-20160816; b=0FgWQ6OcoXcbtEj0Ult8bvCwz1eRt/VTdX9YvR215wU5aTvOxlwt9zoSWJ2ImBHjlw EuV3I+Kr90t94SCeCORTFYIAhA9miRDoSvXgI/fWXgGWIa+wQPIkZ7IWOUFCUpC7Hr1d ofJfecijnjAH4p61nhtiNSR0brYRHGQttK254g52BbUDotKKutxgnPQfTkQizJD3L0aL ODzeCzIrnYcULBhdEhNs08W7wfa3iMN1pMW6FyWK4vG/n40sVWpu8roy+bf/9J6sIDW1 tHAqQIOmI3hsJHNtd1YQUyzsnlVzl22sxpjU0yCidkPeJro2NK5U2JI6UFx8sQCfB+oP kH1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=wXGmgo8wmVuY2OWn/RhzfVOf4dSTvTYsgWyE6GjGRVY=; b=Dn4NbwvgAtmq0iQ7f1pI0YnHIXPEV4nM4F2MobBBZxd5IjrOJK8q11i95OosLBVcsv NZ18272OQPpzxjOJeyE0FM4tx0i1vkONk48PXDmRID92Q3xvbXh9k675nQQN3lrQnz70 TkWoz/IerowY8tM5vPxf5qG5UOzH6ajbLj6HaUCRXQoYk1nyUAScmDZ9gEDN35ZsRtUP +ipUc9ftAR8p69MrAU+FN04uf58wUqHnbreADSKT6tDd7Ud4WbXWku7ozi3kF4gWwYrs d+ZUR00++vo4RgEC6jBrERlGLuUzqZekHc3s5+XDG7YXDi0hN0FDjpvtXEtKV0IpJUZy +qMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=u8oQ48Ql; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g41-20020a056402322900b00457c6b5dc07si8574819eda.455.2022.10.31.12.13.27; Mon, 31 Oct 2022 12:14:01 -0700 (PDT) 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=@suse.cz header.s=susede2_rsa header.b=u8oQ48Ql; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiJaTFo (ORCPT + 99 others); Mon, 31 Oct 2022 15:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiJaTFn (ORCPT ); Mon, 31 Oct 2022 15:05:43 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C99F563C2 for ; Mon, 31 Oct 2022 12:05:39 -0700 (PDT) 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-out1.suse.de (Postfix) with ESMTPS id 6A67522C82; Mon, 31 Oct 2022 19:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1667243138; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wXGmgo8wmVuY2OWn/RhzfVOf4dSTvTYsgWyE6GjGRVY=; b=u8oQ48Ql1+4I8I57qEpGGL80XjKj3uj9RWkyxrWb0WPKoxQdE5sPPqWYenGLNgRiQciVKB LjZd1bHoDA774SD/oobXBnamJSghUFs+BM2CdCwPjCOln3pgfTnW9RgcfXaTmXHdwsDGB7 hMNPg5d1pe1Mbcw/GMNFGzg3e0FwwaE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1667243138; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wXGmgo8wmVuY2OWn/RhzfVOf4dSTvTYsgWyE6GjGRVY=; b=yi14Jan6oPtK6BXGEVKP8M8zOWb7ZmlcSPSwJF9lT4MHlnNYy5SEPqieUHqARG4TcJ6PkG t2mlsaq9wp+0h6DA== 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 02B5F13451; Mon, 31 Oct 2022 19:05:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BVQqNoEcYGM+BQAAMHmgww (envelope-from ); Mon, 31 Oct 2022 19:05:37 +0000 Date: Mon, 31 Oct 2022 20:05:34 +0100 From: Petr Vorel To: Chuck Lever III Cc: Jeff Layton , Linux NFS Mailing List Subject: Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge Message-ID: Reply-To: Petr Vorel References: <20221031154921.500620-1-jlayton@kernel.org> <433f431a3684eb296a62f8f3cdbf34e185a5a84d.camel@kernel.org> <1E40B5C0-1E8A-4FBD-80FB-3432037F101D@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1E40B5C0-1E8A-4FBD-80FB-3432037F101D@oracle.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Oct 31, 2022, at 2:46 PM, Jeff Layton wrote: > > On Mon, 2022-10-31 at 19:45 +0100, Petr Vorel wrote: > >>>> On Oct 31, 2022, at 11:49 AM, Jeff Layton wrote: > >>>> If the namespace doesn't match the one in "net", then we'll continue, > >>>> but that doesn't cause another rhashtable_walk_next call, so it will > >>>> loop infinitely. > >>>> Fixes: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") > >>>> Reported-by: Petr Vorel > >>>> Signed-off-by: Jeff Layton > >>>> --- > >>>> fs/nfsd/filecache.c | 5 ++--- > >>>> 1 file changed, 2 insertions(+), 3 deletions(-) > >>> Thank you! Applied and pushed to for-rc. I'll send a PR in a few days. > >> Thanks for a quick action! > > No problem. > >> What a shame you didn't put link to the report, which contains reproducer. > >> https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/ > >> Kind regards, > >> Petr > > Chuck, could you add that link to the changelog when you merge it? > In progress, I'll push the update in a moment. Thanks a lot! Kind regards, Petr > > Thanks, > > Jeff > >>>> The v1 patch applies cleanly to v6.0, but not to Chuck's for-next > >>>> branch. This one should be suitable there. > >>>> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > >>>> index 98c6b5f51bc8..4a8aa7cd8354 100644 > >>>> --- a/fs/nfsd/filecache.c > >>>> +++ b/fs/nfsd/filecache.c > >>>> @@ -890,9 +890,8 @@ __nfsd_file_cache_purge(struct net *net) > >>>> nf = rhashtable_walk_next(&iter); > >>>> while (!IS_ERR_OR_NULL(nf)) { > >>>> - if (net && nf->nf_net != net) > >>>> - continue; > >>>> - nfsd_file_unhash_and_dispose(nf, &dispose); > >>>> + if (!net || nf->nf_net == net) > >>>> + nfsd_file_unhash_and_dispose(nf, &dispose); > >>>> nf = rhashtable_walk_next(&iter); > >>>> } > >>>> -- > >>>> 2.38.1 > > -- > > Jeff Layton