From owner-svn-src-all@FreeBSD.ORG Wed Aug 26 22:38:05 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EB7810656E5; Wed, 26 Aug 2009 22:38:04 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 42A458FC14; Wed, 26 Aug 2009 22:38:04 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 5C60A359960; Thu, 27 Aug 2009 00:38:03 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 3B7EB228CD; Thu, 27 Aug 2009 00:38:03 +0200 (CEST) Date: Thu, 27 Aug 2009 00:38:03 +0200 From: Jilles Tjoelker To: Bruce Evans Message-ID: <20090826223803.GA33468@stack.nl> References: <200908231244.n7NCiFgc061095@svn.freebsd.org> <20090823213759.GA55039@stack.nl> <20090825031355.B729@besplex.bde.org> <20090825210815.GA8792@stack.nl> <20090826163931.C41472@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090826163931.C41472@delplex.bde.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov Subject: Re: svn commit: r196460 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2009 22:38:05 -0000 On Wed, Aug 26, 2009 at 05:08:57PM +1000, Bruce Evans wrote: > On Tue, 25 Aug 2009, Jilles Tjoelker wrote: > > On Tue, Aug 25, 2009 at 04:07:11AM +1000, Bruce Evans wrote: > >> On Sun, 23 Aug 2009, Jilles Tjoelker wrote: > >> % Index: sys/fs/fifofs/fifo_vnops.c > >> % =================================================================== > >> % --- sys/fs/fifofs/fifo_vnops.c (revision 196459) > >> % +++ sys/fs/fifofs/fifo_vnops.c (working copy) > >> % @@ -193,6 +193,10 @@ > >> % goto fail2; > >> % fip->fi_writesock = wso; > >> % error = soconnect2(wso, rso); > >> % + if (error == 0) > >> % + error = soshutdown(rso, SHUT_WR); > >> % + if (error == 0) > >> % + error = soshutdown(wso, SHUT_RD); > >> % if (error) { > >> % (void)soclose(wso); > >> % fail2: > The second shutdown became harmless for me when I fixed the clobbering of > sb_state. Does it have any effect? It seems not. shutdown(SHUT_RD) basically calls the pru_flush protocol function (which uipc_usrreq.c does not provide), calls socantrecvmore (which uipc_usrreq.c had already done synchronously with the first shutdown) and clears the receive socket buffer (which is already empty). Regarding the direct access to SBS_CANTRCVMORE and SBS_CANTSENDMORE, this seems related to the special property of fifos that they can disconnect and reconnect a stream using the same object. The socket layer normally does not allow clearing SBS_CANTRCVMORE and SBS_CANTSENDMORE. The only case where fifo_vnops.c touches these flags directly where a so* function call could be used is the setting of SBS_CANTRCVMORE on the read side at initial creation (possibly because a wakeup is not necessary there). I suppose the new fifo implementation will avoid abusing sockets this way. -- Jilles Tjoelker