From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Thu, 21 May 2020 10:34:42 +0200 Subject: [Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay In-Reply-To: <20200520233913.GV2491@localhost.localdomain> References: <20200520195509.2215098-1-hch@lst.de> <20200520195509.2215098-32-hch@lst.de> <20200520231001.GU2491@localhost.localdomain> <20200520.162355.2212209708127373208.davem@davemloft.net> <20200520233913.GV2491@localhost.localdomain> Message-ID: <20200521083442.GA7771@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, May 20, 2020 at 08:39:13PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, May 20, 2020 at 04:23:55PM -0700, David Miller wrote: > > From: Marcelo Ricardo Leitner > > Date: Wed, 20 May 2020 20:10:01 -0300 > > > > > The duplication with sctp_setsockopt_nodelay() is quite silly/bad. > > > Also, why have the 'true' hardcoded? It's what dlm uses, yes, but the > > > API could be a bit more complete than that. > > > > The APIs are being designed based upon what in-tree users actually > > make use of. We can expand things later if necessary. > > Sometimes expanding things later can be though, thus why the worry. > But ok, I get it. Thanks. > > The comment still applies, though. (re the duplication) Where do you see duplication? sctp_setsockopt_nodelay does the following things: - verifies optlen, returns -EINVAL if it doesn't match - calls get_user, returns -EFAULT on error - converts the value from get_user to a boolean and assigns it to sctp_sk(sk)->nodelay - returns 0. sctp_sock_set_nodelay does: - call lock_sock - assign true to sctp_sk(sk)->nodelay - call release_sock - does not return an error code