Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp474271rdb; Fri, 26 Jan 2024 00:58:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKvwO0Kus2y0AvJHM2RteDB+ObnO3P7FxiLKj5TzERXARHESab7apTQEVEXfYrx3rUkbcL X-Received: by 2002:a05:6402:5167:b0:55c:ff76:a873 with SMTP id d7-20020a056402516700b0055cff76a873mr711646ede.14.1706259520576; Fri, 26 Jan 2024 00:58:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706259520; cv=pass; d=google.com; s=arc-20160816; b=sineWZTSE/vOxZ4hWnq3SRP5INwS0O8jmBaL3MnYnSFF4qDmBDe86XOXfVHNqyobv0 16JHrcU99WKkZuGKoB5xtJO8Cr4toCq4J/sM5vvy+HbpFRPtqg85+FNm98F+yf+m9Qrd b1oMwzXSeMjXrm8XFSzMLri+4QG8iDpeOfTmL2FUO3v7M2rKXi+kw5WH1dt/CjnxDOWs 2kXy3b754mTevs0/enELmJ5ffwMlCmOZAvT4U0txpAiwbbTLopq5S+EZCm7kNi5W8F82 MvOF1k28ZE0T8dIIU6qMSLv1+vsureoK45JD2FjNnszXek3ShkwmvcW74dJvzOEic5ZC xs3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:references:in-reply-to:subject:cc:to:from :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=z/2ZWD0aX6DVLsqYxQrCHNgwHrQVXAkUwctAhMPow9I=; fh=Sy5DWuITFiabmeiw8zDabmNCvPGag3I2hqn3YRkFLRY=; b=w7FIyfmHFaFi0ax/R7AWRXuwsGcjjxsXunRRUFF1bYq/MPljgZ6MEHgZrPcCzq9FIi WD3p4ZmlhyxLzVtPOYrUT8AilAqN135fWKU6vFhmI+deQvJmN7ZESvnCkEqH14rwww0p 7VsYhnEt6lhAgRECKE2Tkw9FzHYdSC5JJLk5MftDpz+ot7kFWhIdB0uqWNE4WR/98bZy rftejDxPCx2jRv0jiy7AqN+PlTNTFd56IcCx7T2bZtG1L0iTxD8nWDpco7qToqGoaKJ8 5OhGkEnBmGLRMUtiu+uOJWY905VxOypYwQDSFle+1WhWFXk8TcgdMfawWwK5CTEqSHdf ijGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Fw4e8BGc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Fw4e8BGc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=8mBylZ2M; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-1455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b11-20020a0564021f0b00b0055d3916b7d9si184508edb.346.2024.01.26.00.58.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 00:58:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Fw4e8BGc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Fw4e8BGc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=8mBylZ2M; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-1455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 295621F218A0 for ; Fri, 26 Jan 2024 08:58:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82C7F45963; Fri, 26 Jan 2024 07:27:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Fw4e8BGc"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8mBylZ2M"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Fw4e8BGc"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8mBylZ2M" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D68A52A1B0; Fri, 26 Jan 2024 07:27:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706254061; cv=none; b=iqsO1XLANmnIjmewAeQaaKvAYKiTSUq2TkTrgeRHkagFnQ9DkuTIK+HnwVD2sFeTLuHdyfpIslgamJwLxCVU9zy5L+Eiv0zHRDWv1H8f8+TRtiKU1mlfseYAy0se5GUYhnT+A8cJWpnltqwOCW1dHqSBeGSvGaijfFDLZzImNtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706254061; c=relaxed/simple; bh=GINjbe2szq535SXFdiGwXNCMoePT2lkGqtDutSceO/Y=; h=Content-Type:MIME-Version:From:To:Cc:Subject:In-reply-to: References:Date:Message-id; b=pyAG+aK5TjFmYrgj+OwGVOrks4IoT0oSDFsKe53MVv1ZPrf5hw39YgDHRjygPv2h5vYGNViw4aw6xVajFsPnxt1FkuNrlBzpnmB55Pz0a6P4zdSxRhkePS18idZ98NFa6NP9z20niof1q9LvgBokaJRw1pLgSfMwINlFK0dFdqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Fw4e8BGc; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8mBylZ2M; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Fw4e8BGc; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8mBylZ2M; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7A66B1FB65; Fri, 26 Jan 2024 07:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706254056; 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=z/2ZWD0aX6DVLsqYxQrCHNgwHrQVXAkUwctAhMPow9I=; b=Fw4e8BGcWSZd8D6WB8hvPrizDOjApux9P1uDEkD/VwBar6DeCCwzCglGbRQARq4c9LcmIk Kk/1zdRnaW54DRqWRIaabLby0kepHsmWBV9UyPJhDVtPq/bbE4RGCKaN0iK68iToh2R+EH ATDnHTTOJ12Bw+EMmMvEDx1fiIjM4ro= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706254056; 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=z/2ZWD0aX6DVLsqYxQrCHNgwHrQVXAkUwctAhMPow9I=; b=8mBylZ2M2Ew22jXrdXxN10nZuuPNQwJhEncNYQyJgv2cGpo3XwdREcYw5Nej+9AK+LqVQx flC0mL2LKNPkZICA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706254056; 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=z/2ZWD0aX6DVLsqYxQrCHNgwHrQVXAkUwctAhMPow9I=; b=Fw4e8BGcWSZd8D6WB8hvPrizDOjApux9P1uDEkD/VwBar6DeCCwzCglGbRQARq4c9LcmIk Kk/1zdRnaW54DRqWRIaabLby0kepHsmWBV9UyPJhDVtPq/bbE4RGCKaN0iK68iToh2R+EH ATDnHTTOJ12Bw+EMmMvEDx1fiIjM4ro= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706254056; 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=z/2ZWD0aX6DVLsqYxQrCHNgwHrQVXAkUwctAhMPow9I=; b=8mBylZ2M2Ew22jXrdXxN10nZuuPNQwJhEncNYQyJgv2cGpo3XwdREcYw5Nej+9AK+LqVQx flC0mL2LKNPkZICA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E3B6A134C3; Fri, 26 Jan 2024 07:27:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id NQi8JuVes2WrZQAAD6G6ig (envelope-from ); Fri, 26 Jan 2024 07:27:33 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever III" Cc: "Jeff Layton" , "Lorenzo Bianconi" , "Linux NFS Mailing List" , "Lorenzo Bianconi" , "Jakub Kicinski" , "Simon Horman" , "open list:NETWORKING [GENERAL]" Subject: Re: [PATCH v6 3/3] NFSD: add write_ports to netlink command In-reply-to: References: , , <9e3ae337dcf168c60c4cfd51aa0b2fc7b24bcbfb.camel@kernel.org>, <170595930799.23031.17998490973211605470@noble.neil.brown.name>, , , <85b02061798a1b750a87b0302681b86651d0c7a3.camel@kernel.org>, , <3f035d3bc494ec03b83ae237e407c42f2ddc4c53.camel@kernel.org>, , <8fabd83caa0d44369853a4040a89c069f9b0f935.camel@kernel.org>, <917EC07C-C9D9-4CF2-9ACB-DCA2676DFF67@oracle.com>, <170622264103.21664.16941742935452333478@noble.neil.brown.name>, Date: Fri, 26 Jan 2024 18:27:27 +1100 Message-id: <170625404709.21664.1810481700674698939@noble.neil.brown.name> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Fw4e8BGc; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=8mBylZ2M X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-9.51 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[8]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; TO_DN_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: -9.51 X-Rspamd-Queue-Id: 7A66B1FB65 X-Spam-Flag: NO On Fri, 26 Jan 2024, Chuck Lever III wrote: >=20 >=20 > > On Jan 25, 2024, at 5:44=E2=80=AFPM, NeilBrown wrote: > >=20 > > On Thu, 25 Jan 2024, Chuck Lever III wrote: > >>=20 > >>=20 > >>> On Jan 24, 2024, at 6:24=E2=80=AFAM, Jeff Layton w= rote: > >>>=20 > >>> On Wed, 2024-01-24 at 10:52 +0100, Lorenzo Bianconi wrote: > >>>> [...] > >>>>>=20 > >>>>> That's a great question. We do need to properly support the -H option= to > >>>>> rpc.nfsd. What we do today is look up the hostname or address using > >>>>> getaddrinfo, and then open a listening socket for that address and th= en > >>>>> pass that fd down to the kernel, which I think then takes the socket = and > >>>>> sticks it on sv_permsocks. > >>>>>=20 > >>>>> All of that seems a bit klunky. Ideally, I'd say the best thing would= be > >>>>> to allow userland to pass the sockaddr we look up directly via netlin= k, > >>>>> and then let the kernel open the socket. That will probably mean > >>>>> refactoring some of the svc_xprt_create machinery to take a sockaddr, > >>>>> but I don't think it looks too hard to do. > >>>>=20 > >>>> Do we already have a specific use case for it? I think we can even add= it > >>>> later when we have a defined use case for it on top of the current ser= ies. > >>>>=20 > >>>=20 > >>> Yes: > >>>=20 > >>> rpc.nfsd -H makes nfsd listen on a particular address and port. By > >>> passing down the sockaddr instead of an already-opened socket > >>> descriptor, we can achieve the goal without having to open sockets in > >>> userland. > >>=20 > >> Tearing down a listener that was created that way would be a > >> use case for: > >=20 > > Only if it was actually useful. > > Have you *ever* wanted to do that? Or heard from anyone else who did? >=20 > Container shutdown will want to clear out any listener > that might have been created during the container's > lifetime. How is that done today? Is that simply handled > by net namespace tear-down? Yes. When the last thread in a netns exits, nfsd_last_thread() is called which closes all sockets. NeilBrown