Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1229210ybk; Thu, 21 May 2020 01:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl2zPk/1kBJm0vqedVOcTRZeNPRCJJZXWu+VWkkiNVGHY3LFVaun5tGqrajWW1N/BNsqxS X-Received: by 2002:a17:906:355b:: with SMTP id s27mr2495351eja.492.1590050576528; Thu, 21 May 2020 01:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590050576; cv=none; d=google.com; s=arc-20160816; b=uVEtYnF8JSIPSPwm0YiH8PhEgDPOhXKOEkAaqbYrEagq3yb4NJnz2TbtbRFwu74Uno DlSILa1uzETxt33NakV1xAFc/1458x8V5BgMYEvAizaLAlAACOA+HMBWsSutAPBSAdEE nppF5ykm2gef+Or1INN15A4SQxohVWu0pFz1Hi9xmgsHkQugaDDmFwNjgppgpOsuvasf sGVLvjWosRNFldpVnRr8PKHFFg4rGKivuaYzWJ4OIlikNxofS8VxA7DbUu0NzyUfOyTS lVbGQX+LKu5x0W79OfbRFBVWtzGmxw/XYTaY4v7LKTfr/FLbAN/cLu2TNHR20Etl1YUw jYLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mNsRD8+k/jgRp6o5+w4N1Z/p9Shp3mBBQHRxzUX3wJI=; b=baWaOifiozZ3EvIAx6qY0LcQSngv2eZMWfdH7HhaCD9p7dYREKx/7d+Gws436oRPGL +STEICw1SPWRpwp9cVJw+buHxhpGhMJ4bO6/lq7SBR0IEC3TLBQ0S0TEJb1nxQtvi6V4 pDCPb39HhOlppWoNdio3EKZ6JF1W+gRQjaMe8APpVEfs3bu1x8bMlsAl0SdEtnKsVvzS B1yphxQTAQNOawNUx3TvyU2t+tEtz7OJOlxe/GWXD/oJiq5Kf5okna/wQ7brX+z1LU/D ZHI5uf3C+aoSnsU00RVwOQc7ZmbMq9tXcGhRQSKkGCCpU1q/m1MFElmhFMLGv5s6oCVo HhqA== ARC-Authentication-Results: i=1; mx.google.com; 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 r19si2628969edm.596.2020.05.21.01.42.32; Thu, 21 May 2020 01:42:56 -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; 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 S1728669AbgEUImb (ORCPT + 99 others); Thu, 21 May 2020 04:42:31 -0400 Received: from verein.lst.de ([213.95.11.211]:53697 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbgEUIma (ORCPT ); Thu, 21 May 2020 04:42:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 1D9C368BEB; Thu, 21 May 2020 10:42:25 +0200 (CEST) Date: Thu, 21 May 2020 10:42:24 +0200 From: Christoph Hellwig To: Marcelo Ricardo Leitner Cc: Christoph Hellwig , "David S. Miller" , Jakub Kicinski , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Vlad Yasevich , Neil Horman , Jon Maloy , Ying Xue , drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, target-devel@vger.kernel.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, ceph-devel@vger.kernel.org, rds-devel@oss.oracle.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH 32/33] net: add a new bind_add method Message-ID: <20200521084224.GA7859@lst.de> References: <20200520195509.2215098-1-hch@lst.de> <20200520195509.2215098-33-hch@lst.de> <20200520230025.GT2491@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520230025.GT2491@localhost.localdomain> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, May 20, 2020 at 08:00:25PM -0300, Marcelo Ricardo Leitner wrote: > > + if (err) > > + return err; > > + > > + lock_sock(sk); > > + err = sctp_do_bind(sk, (union sctp_addr *)addr, af->sockaddr_len); > > + if (!err) > > + err = sctp_send_asconf_add_ip(sk, addr, 1); > > Some problems here. > - addr may contain a list of addresses > - the addresses, then, are not being validated > - sctp_do_bind may fail, on which it requires some undoing > (like sctp_bindx_add does) > - code duplication with sctp_setsockopt_bindx. sctp_do_bind and thus this function only support a single address, as that is the only thing that the DLM code requires. I could move the user copy out of sctp_setsockopt_bindx and reuse that, but it is a rather rcane API. > > This patch will conflict with David's one, > [PATCH net-next] sctp: Pull the user copies out of the individual sockopt functions. Do you have a link? A quick google search just finds your mail that I'm replying to. > (I'll finish reviewing it in the sequence) > > AFAICT, this patch could reuse/build on his work in there. The goal is > pretty much the same and would avoid the issues above. > > This patch could, then, point the new bind_add proto op to the updated > sctp_setsockopt_bindx almost directly. > > Question then is: dlm never removes an addr from the bind list. Do we > want to add ops for both? Or one that handles both operations? > Anyhow, having the add operation but not the del seems very weird to > me. We generally only add operations for things that we actually use. bind_del is another logical op, but we can trivially add that when we need it.