From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755500AbZCDEqg (ORCPT ); Tue, 3 Mar 2009 23:46:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753163AbZCDEq1 (ORCPT ); Tue, 3 Mar 2009 23:46:27 -0500 Received: from THUNK.ORG ([69.25.196.29]:54033 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbZCDEq0 (ORCPT ); Tue, 3 Mar 2009 23:46:26 -0500 Date: Tue, 3 Mar 2009 23:46:14 -0500 From: Theodore Tso To: Steven Rostedt Cc: Andrew Morton , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Frederic Weisbecker , Arjan van de Ven , Pekka Paalanen , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Mathieu Desnoyers , Martin Bligh , "Frank Ch. Eigler" , Tom Zanussi , Masami Hiramatsu , KOSAKI Motohiro , Jason Baron , Christoph Hellwig , Jiaying Zhang , Eduard - Gabriel Munteanu , mrubin@google.com, md@google.com, Steven Rostedt Subject: Re: [PATCH 5/5] tracing: add binary buffer files for use with splice Message-ID: <20090304044614.GL32284@mit.edu> Mail-Followup-To: Theodore Tso , Steven Rostedt , Andrew Morton , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Frederic Weisbecker , Arjan van de Ven , Pekka Paalanen , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Mathieu Desnoyers , Martin Bligh , "Frank Ch. Eigler" , Tom Zanussi , Masami Hiramatsu , KOSAKI Motohiro , Jason Baron , Christoph Hellwig , Jiaying Zhang , Eduard - Gabriel Munteanu , mrubin@google.com, md@google.com, Steven Rostedt References: <20090304024921.153061228@goodmis.org> <20090304025251.015368537@goodmis.org> <20090303193501.0055e329.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 03, 2009 at 10:43:16PM -0500, Steven Rostedt wrote: > > Conventionally a read() system call will return the number of bytes > > copied, and will only return -EFOO if the number of bytes copied was > > zero. > > > > Lots of parts of the kernel break this, but it's usually device drivers > > and scruffy pseudo files, in which case a partial file read doesn't > > make much sense. This doesn't make the broken behaviour right, but at > > least we have a bit of a weaselly excuse in that case. > > > > I just went by the read man page: > > EFAULT buf is outside your accessible address space. > What is normally done in this case if buf is within the addressable space, but buf+x is not, where x < len, then read(fd, buf, len) will fill copy as many characters it can into buf until it runs out of valid addres space, and then return that count as a partial read. - Ted