Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp509149rdb; Tue, 31 Oct 2023 13:47:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGU4yboUTajehzDk00qJ21L2PED5DgVDlA02dvH7whPaFScKqbOAxapMrg3LOgU5bOk8Bs8 X-Received: by 2002:a05:6a20:7aa7:b0:180:de1d:b93e with SMTP id u39-20020a056a207aa700b00180de1db93emr3079542pzh.28.1698785220704; Tue, 31 Oct 2023 13:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698785220; cv=none; d=google.com; s=arc-20160816; b=MLB6l4OFKWewZdtMrTZIRD6+lTT1vLfJmv9kIPhVo4cf3Po3aYpUpORaS2Xka/H069 vQCRg/dWqfqNi1Riw9CAsQF9uGZFoHNWu39pNrevxSJfYDoE+4CEXCJE3cECK9F/LXVa aMzNcHua4afP1yscL3IuUmllu0KzlEMOYiAbdYqwlY7078fw5PNw0LoUhiRMV+/n8XsO 0pUH8AWN0t7hydusiOMEU7iPFoasJSFLcQJeVgB5M8umsNMCrX9MuKVKv2cYg8EOjoQ1 RrsyaYmxPFhqh+0PzxkzJTApAbmuvAY1ZFVpYuV18nPJjoDJpTVZh0H9tCxXK9mW4QOB rdKA== 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=pSBbH5r7NIf19qebDgU+2gNb/lXtnmSkmQvbKzmWh7I=; fh=yLjDJJsW5hslygGs/rbQ408wfQLi857ZoEWDXCtUCaE=; b=AIUwf79Va9eH1+GtjQJgihoehABJ4fWVnHnXs5DNveeGigg41zZsD1kxFohB/CPIDd fVZwDzNRaa62kcDEsVxmZdZEFHRBYKPPah+FHQS+tYu1+zgZrWUU81+g6mzlnYeWHAJT PgxrpKxsZfkQvWZYLCFNc4Yd71PygcXNhmaom6kiSLFkK+6gkFNCEIClY+RY2pSBKJ2A tD9bwXT94OaTmFlTMRWdNR72FApO5X1qSauotdOmjNft5yI+BoPkj6XoIojU0GEC0a9s kLqj+DxRgsMJGBOF5RATfG6w4UkXwCbWgxndnvYRmZSisODZ5NEXxdzsDebc0Gr80/Bc 4s2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tweumJNB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 z1-20020aa78881000000b0068e2b901138si152153pfe.158.2023.10.31.13.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 13:47:00 -0700 (PDT) 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=tweumJNB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 E4EDB801BA83; Tue, 31 Oct 2023 13:46:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbjJaUq5 (ORCPT + 99 others); Tue, 31 Oct 2023 16:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjJaUq4 (ORCPT ); Tue, 31 Oct 2023 16:46:56 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9D0F9 for ; Tue, 31 Oct 2023 13:46:53 -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 D3B332183A; Tue, 31 Oct 2023 20:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1698785211; 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=pSBbH5r7NIf19qebDgU+2gNb/lXtnmSkmQvbKzmWh7I=; b=tweumJNB4zTjafnKt4kVoVon0dy3deyDpFWeQ1jUOkC4wERo8kOq/e5W9/Vty/YfSMu4PO Rk6u455XZALJ5dJEgZRcKOlGjoF+0MgC6Z6+hW2+ndugAY9KzAKvfONjI9UewdczdTmoYS /FmstWxqiJILfbxjgQKM8A1CZla0B7U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1698785211; 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=pSBbH5r7NIf19qebDgU+2gNb/lXtnmSkmQvbKzmWh7I=; b=maBo1J451+HZPRRJr/krVU4sDlBWkZd9MciA3r4We5p1ebIWjPTuOghtlmm+7bBOsYEeTI zLQcXsDC7qO5TcCg== 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 CAD48138EF; Tue, 31 Oct 2023 20:46:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +OduILlnQWWTTwAAMHmgww (envelope-from ); Tue, 31 Oct 2023 20:46:49 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever III" Cc: "Jeff Layton" , "Linux NFS Mailing List" , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" Subject: Re: [PATCH 0/5] sunrpc: not refcounting svc_serv In-reply-to: References: <20231030011247.9794-1-neilb@suse.de>, <9BA28F70-A3FC-4EC4-A638-A27C1867F221@oracle.com>, <169878484259.24305.17786556797570881562@noble.neil.brown.name>, Date: Wed, 01 Nov 2023 07:46:46 +1100 Message-id: <169878520677.24305.4940476987470825179@noble.neil.brown.name> 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]); Tue, 31 Oct 2023 13:46:57 -0700 (PDT) On Wed, 01 Nov 2023, Chuck Lever III wrote: > > > On Oct 31, 2023, at 1:40 PM, NeilBrown wrote: > > > > On Wed, 01 Nov 2023, Chuck Lever III wrote: > >> > >>> On Oct 29, 2023, at 6:08 PM, NeilBrown wrote: > >>> > >>> This patch set continues earlier work of improving how threads and > >>> services are managed. Specifically it drop the refcount. > >>> > >>> The refcount is always changed under the mutex, and almost always is > >>> exactly equal to the number of threads. Those few cases where it is > >>> more than the number of threads can usefully be handled other ways as > >>> see in the patches. > >>> > >>> The first patches fixes a potential use-after-free when adding a socket > >>> fails. This might be the UAF that Jeff mentioned recently. > >>> > >>> The second patch which removes the use of a refcount in pool_stats > >>> handling is more complex than I would have liked, but I think it is > >>> worth if for the result seen in 4/5 of substantial simplification. > >> > >> So I need a v2 of this series, then... > >> > >> - Move 4/5 to the beginning of the series (patch 1 or 2, doesn't matter) > > > > I don't understand.... 2 and 3 are necessary prerequisites for 4. The > > remove places where the refcount is used. > > Hrm. that's what I was afraid of. > > Isn't there a fix in 4/5 that we want applied to stable kernels, > or did I misunderstand the email exchange between you and Jeff? > That is Commit bf32075256e9 ("NFSD: simplify error paths in nfsd_svc()") which is already in nfsd-next. NeilBrown > > -- > Chuck Lever > > >