From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:52650 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753569AbcLRWS5 (ORCPT ); Sun, 18 Dec 2016 17:18:57 -0500 Date: Sun, 18 Dec 2016 22:18:53 +0000 From: Al Viro To: Linus Torvalds Cc: Andreas Schwab , Dave Chinner , CAI Qian , linux-xfs , xfs@oss.sgi.com, Jens Axboe , Nick Piggin , linux-fsdevel Subject: Re: [PATCH 04/12] splice: lift pipe_lock out of splice_to_pipe() Message-ID: <20161218221853.GA1555@ZenIV.linux.org.uk> References: <20160923190326.GB2356@ZenIV.linux.org.uk> <20160923201025.GJ2356@ZenIV.linux.org.uk> <20160924035951.GN2356@ZenIV.linux.org.uk> <87shpmxrey.fsf@linux-m68k.org> <20161218201207.GY1555@ZenIV.linux.org.uk> <20161218203003.GZ1555@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, Dec 18, 2016 at 02:10:54PM -0800, Linus Torvalds wrote: > On Sun, Dec 18, 2016 at 12:30 PM, Al Viro wrote: > > > > OK, I see what's going on - it's wait_for_space() lifted past the checks > > for lack of readers. The fix, AFAICS, is simply > > Ugh. Does it have to be duplicated? > > How about just making the wait_for_space() loop be a for-loop, and writing it as > > for (;;) { > if (unlikely(!pipe->readers)) { > send_sig(SIGPIPE, current, 0); > return -EPIPE; > } > if (pipe->nrbufs == pipe->buffers) ITYM "!="...