Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp410249pxb; Wed, 6 Oct 2021 07:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1ck9+fXOqvfQHECaMrm5wpdefB20YORu9U4agVLeeLgdIr83T2koeP2qhdukCwZEw8hl7 X-Received: by 2002:a62:8048:0:b0:44b:bd7f:4666 with SMTP id j69-20020a628048000000b0044bbd7f4666mr36755375pfd.71.1633530834840; Wed, 06 Oct 2021 07:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633530834; cv=none; d=google.com; s=arc-20160816; b=u4V96dwGYlEWdwqZuthMiZdDpLKUMznsdrSqpXCpzBr56lFTHtezNjIUGQh1KMua5w QrCyiSyvvNG6UFkpZYjU9LKvEvNOvuzdpRgTm7XRb9pQnypEZxki8m4uwJo5U1Pgs5Ql 47PznYeC5MV0PSii0Oslz0+eTX2ezyeJ+syml9oyH7ZIEwMu7dPeNjnbfMnsNR7TTMJV aOmqI7Fa9GDogiQLqzRcbz5I2ltZeSAHPgb6PvgSg4OyozMA/dwOHaXhbvB1YqS4jW+U c6WWjqpGY74+Xu69UFKGNISZjoM6Vs5X8P86mZirKhhrncFI1CSfMAS1V0mM58gBO+Wy nZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=T72+NZqfghdbb51MB1XfcxqKua1U0na8W1wsF55f7bQ=; b=I2TKTHYCNBc85RXqNr6cUtDPZbbnOWsxbu+uBtw0Ypc14ynNVoG/RSbXLEbv4vd5+l 6II1CfDkF6Q4Axpk0ngoHzd5Bd2rwWlpVfIMUhJIWa4FRoF1SZ3VUi0AelIT00l/iwcl ME26DSxeFatIuc3j1AtcONzw3tvuN9YAFRk8PVvubcagwQygQjqS12hfRvU9z1g2ZoQ9 UtjY5MtK1nJHCsIUrx87mhAqMDHxz01wmRHXslK/IOmIvU5d0GWi12fWaKy3OvSo+8nM xuZZYPRts4ZK/owf1FhL2G6gAmfZyRygMq14DIOvUzBpv2FLkYoqvALABak6ygNspkKt L3fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=YzTmG+As; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si29355208pgk.421.2021.10.06.07.33.38; Wed, 06 Oct 2021 07:33:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=YzTmG+As; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231776AbhJFOf3 (ORCPT + 99 others); Wed, 6 Oct 2021 10:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbhJFOf2 (ORCPT ); Wed, 6 Oct 2021 10:35:28 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7E0C061749 for ; Wed, 6 Oct 2021 07:33:36 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 0E95F14DE; Wed, 6 Oct 2021 10:33:35 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 0E95F14DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1633530815; bh=T72+NZqfghdbb51MB1XfcxqKua1U0na8W1wsF55f7bQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YzTmG+AsuIYtQ8nhWK+NZg4V1reWsYNhr3A4zg3ow5cb2l7vUaKAvj/MVSiC9qUsN hbhBeajfaAkIN5A9boNSdHNzzQ3i4dfufy6nZQ0MZBdOVdFfuZFIaoB8j6ig5hrkWR 87XSL07EWd8p5vq3M+A30ryfQaDq7m8LL5p5bF9U= Date: Wed, 6 Oct 2021 10:33:35 -0400 From: "J. Bruce Fields" To: Benjamin Coddington Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH] NFSD: Keep existing listners on portlist error Message-ID: <20211006143335.GA15343@fieldses.org> References: <45b916f1aa3fb7c059a574f61188a8f2f615410e.1633529847.git.bcodding@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45b916f1aa3fb7c059a574f61188a8f2f615410e.1633529847.git.bcodding@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Oct 06, 2021 at 10:18:05AM -0400, Benjamin Coddington wrote: > If nfsd has existing listening sockets without any processes, then an error > returned from svc_create_xprt() for an additional transport will remove > those existing listeners. We're seeing this in practice when userspace > attempts to create rpcrdma transports without having the rpcrdma modules > present before creating nfsd kernel processes. Fix this by checking for > existing sockets before callingn nfsd_destroy(). That seems like an improvement. I'm curious, though, what the rpc.nfsd behavior is on partial failure. And what do we want it to be? If a user runs rpc.nfsd expecting it to start up tcp and rdma, but rdma fails, do we want rpc.nfsd to succeed or fail? Should it exit with nfsd running or not? --b. > > Signed-off-by: Benjamin Coddington > --- > fs/nfsd/nfsctl.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c > index c2c3d9077dc5..df4613a4924c 100644 > --- a/fs/nfsd/nfsctl.c > +++ b/fs/nfsd/nfsctl.c > @@ -793,7 +793,10 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr > svc_xprt_put(xprt); > } > out_err: > - nfsd_destroy(net); > + if (list_empty(&nn->nfsd_serv->sv_permsocks)) > + nfsd_destroy(net); > + else > + nn->nfsd_serv->sv_nrthreads--; > return err; > } > > -- > 2.30.2