From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [patch v3] splice: fix race with page invalidation Date: Thu, 31 Jul 2008 10:00:17 -0700 (PDT) Message-ID: References: <200807312259.43402.nickpiggin@yahoo.com.au> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Miklos Szeredi , jens.axboe@oracle.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org To: Nick Piggin Return-path: In-Reply-To: <200807312259.43402.nickpiggin@yahoo.com.au> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 31 Jul 2008, Nick Piggin wrote: > > It seems like the right way to fix this would be to allow the splicing > process to be notified of a short read, in which case it could try to > refill the pipe with the unread bytes... Hmm. That should certainly work with the splice model. The users of the data wouldn't eat (or ignore) the invalid data, they'd just say "invalid data", and stop. And it would be up to the other side to handle it (it can see the state of the pipe, we can make it both wake up POLL_ERR _and_ return an error if somebody tries to write to a "blocked" pipe). So yes, that's very possible, but it obviously requires splice() users to be able to handle more cases. I'm not sure it's realistic to expect users to be that advanced. Linus