From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Becker Subject: Re: Read/write counts Date: Mon, 4 Jun 2007 12:24:52 -0700 Message-ID: <20070604192452.GD6528@ca-server1.us.oracle.com> References: <20070604163327.GR5181@schatzie.adilger.int> <20070604170223.GF23968@parisc-linux.org> <20070604183342.GC19224@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Theodore Tso , Matthew Wilcox , Bryan Henderson , Andreas Dilger , "David H. Lynch Jr." , linux-fsdevel@vger.kernel.org To: Roman Zippel Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:61227 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761844AbXFDTZR (ORCPT ); Mon, 4 Jun 2007 15:25:17 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Jun 04, 2007 at 08:57:16PM +0200, Roman Zippel wrote: > On Mon, 4 Jun 2007, Theodore Tso wrote: > > > Hmm, I'm not sure I would go that far. Per the POSIX specification, > > we support the optional BSD-style restartable system calls for signals > > which will avoid short reads; but this is only true if SA_RESTART is > > passed to sigaction(). Without SA_RESTART, we will indeed return > > short reads, as required by POSIX. > > > > I don't think Linus has said that short reads are always evil; I > > certainly can't remember him ever making that statement. Do you have > > a pointer to a LKML message where he's said that? > > That's the last discussion about signals and I/O I can remember: > http://www.ussg.iu.edu/hypermail/linux/kernel/0208.0/0188.html He said 'disk read', not 'read(2)'. I'd expect he means certain things like stat(2) and readdir(2) when they have to go to disk. read(2) explicitly lists EINTR as a valid result, and often folks use signals to interrupt read(2). The world certainly writes programs to expect short read(2). Joel -- "Gone to plant a weeping willow On the bank's green edge it will roll, roll, roll. Sing a lulaby beside the waters. Lovers come and go, the river roll, roll, rolls." Joel Becker Principal Software Developer Oracle E-mail: joel.becker@oracle.com Phone: (650) 506-8127