Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp445326rdg; Tue, 10 Oct 2023 15:30:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYuCArFMXElUwsOQS8pZNGrWLaBPAXPeP59oui9jfOPcD/jMSivNUWvjACs0FSzS+gLiLM X-Received: by 2002:a17:90a:2a08:b0:262:fc8a:ed1 with SMTP id i8-20020a17090a2a0800b00262fc8a0ed1mr17885715pjd.44.1696977034831; Tue, 10 Oct 2023 15:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696977034; cv=none; d=google.com; s=arc-20160816; b=mWTcxEFYW/e/AEJbstHk+oY9CqfSMvHbPY2c30dgz/gWV/an4eg0tscdN6hbKwyTqt GgaDX6NIT7qnq+GzmQ4DOKZE3sTxm/2kEJELD0mxLMhTEA9hzXDMfghcYNlmTD1K0qFn 4tUI8Jo5ABAG8yDgUMa22qfXtsunkTwB2LcPJp7CtmbjQF2PZ9XEKFh/0xhNbODpQpUz /EVqQvKR0Fotvc7zfsPpm8kJ1LQ6vZvcyWy/41D0aD4FO/pHeRuV1nvbZlVhlngMMHyj mKCMGNUR15ip/XQID+RlU9fJz7T/k3M5AD91elURyVibVQ5wFRG3eIXtN1dXKMDJHi0N 8Xsw== 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=7M56PoZvRnYHJXBhK6lrWfnNCxCQ5r3Vk/yZ9cXnRZA=; fh=yLjDJJsW5hslygGs/rbQ408wfQLi857ZoEWDXCtUCaE=; b=eimlxalMNJ8de78eonF8HpspoBtwyv4/l0Y6WToNkNu/2RnlZFnWY3OZvEJD87KcqF /OfFtjkUovx58gi7VCYCrmseO/BkgctQWQDhDKndtBjDhUuEdY5wOUTUDigsfH9r+RlR 3SdCW9IU/urb++NuuV4jl51F0QtLy7VAfw8nVkEspv6DSpDojCU4NCwCUDSN+mA9ymaG VES4yQT8/q2l/sfTtns1wA12GTrNmg+pSfhZIhsXMIvCn6+tA81uEwAQQ0hhQ/f6L/Dm yYnfd/lqVzmUn/Rc5CuJw65Yt9e6T3ozhs/YPUKjgYGzVAG/RLfzVb6DaBh/jlcffZUj UNyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kXtqpjsp; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=7gQE++bx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id il8-20020a17090b164800b002791e648ceasi14227183pjb.112.2023.10.10.15.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:30:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kXtqpjsp; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=7gQE++bx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id E5E91806E2BE; Tue, 10 Oct 2023 15:30:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbjJJWaZ (ORCPT + 99 others); Tue, 10 Oct 2023 18:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234402AbjJJWaW (ORCPT ); Tue, 10 Oct 2023 18:30:22 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E89AF0 for ; Tue, 10 Oct 2023 15:30:14 -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-out2.suse.de (Postfix) with ESMTPS id B4F7C1F6E6; Tue, 10 Oct 2023 22:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696977012; 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=7M56PoZvRnYHJXBhK6lrWfnNCxCQ5r3Vk/yZ9cXnRZA=; b=kXtqpjspHBmFsS5uczBat61KGInKIzzG3XbN6z6RJ4zxSLaiE+arOWb50FYLeC4NZEjP6z sLsDebw1l1uvPiSbJl2VTtZadhppJ6JsY/yx2Sde5iERuz0W7Dl7y20giulojXuUBZko1O OWVqfXcWNdyFB2t4zPfrK2sapSGXTx8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696977012; 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=7M56PoZvRnYHJXBhK6lrWfnNCxCQ5r3Vk/yZ9cXnRZA=; b=7gQE++bxuHj0BAVb8F4g7UjV6nAzs6xvEv4JS0/Mpdi/OvboRrRKJ5g4aMKkiclr8TiNZ6 ywMNdsPtyN5RTYDA== 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 88B761358F; Tue, 10 Oct 2023 22:30:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8gzTDnLQJWUSMAAAMHmgww (envelope-from ); Tue, 10 Oct 2023 22:30:10 +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] lockd: hold a reference to nlmsvc_serv while stopping thread. In-reply-to: <834A724C-4A44-4277-AFB5-D639FCF2900B@oracle.com> References: <169689454310.26263.15848180396022999880@noble.neil.brown.name>, <834A724C-4A44-4277-AFB5-D639FCF2900B@oracle.com> Date: Wed, 11 Oct 2023 09:30:06 +1100 Message-id: <169697700659.26263.12600384009390271074@noble.neil.brown.name> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 15:30:32 -0700 (PDT) X-Spam-Level: ** On Tue, 10 Oct 2023, Chuck Lever III wrote: > > > On Oct 9, 2023, at 7:35 PM, NeilBrown wrote: > > We are required to hold a reference to the svc_serv struct while > > stopping the last thread, as doing that could otherwise drop the last > > reference itself and the svc_serv would be freed while still in use. > > > > lockd doesn't do this. After startup, the only reference is held by the > > running thread. > > > > So change locked to hold a reference on nlmsvc_serv while-ever the > > service is active, and only drop it after the last thread has been > > stopped. > > > > Note: it doesn't really make sense for threads to hold references to the > > svc_serv any more. The fact threads are included in serv->sv_nrthreads > > is sufficient. Maybe a future patch could address this. > > > > Reported-by: Jeff Layton > > Fixes: 68cc388c3238 ("SUNRPC: change how svc threads are asked to exit.") > > Signed-off-by: NeilBrown > > Thanks for the fast response! > > Should I squash this into 68cc, or apply it before? I would > like to ensure that bisect works nicely over this series of > commits. Probably makes sense to put it before. In that case the patch description needs re-wording. And on reflection I think the code should be changed a little so that it matches similar code in nfsd and nfs4-callback. So I'll repost. I'll take the liberty of preserving Jeff's review/test even though I've changed the code .... I hope that's OK. NeilBrown