From: Peter Zijlstra Subject: Re: file offset corruption on 32-bit machines? Date: Tue, 15 Apr 2008 22:28:55 +0200 Message-ID: <1208291336.7053.16.camel@lappy> References: <20080414165354.GF15824@duck.suse.cz> <20080414170613.GI7385@csclub.uwaterloo.ca> <20080414190308.GJ15824@duck.suse.cz> <20080414192928.GM7385@csclub.uwaterloo.ca> <20080415085740.GA7603@atrey.karlin.mff.cuni.cz> <20080415153221.GD7387@csclub.uwaterloo.ca> <20080415173430.GB4994@elf.ucw.cz> <20080415182453.GR7385@csclub.uwaterloo.ca> <20080415191238.GC4994@elf.ucw.cz> <20080415194922.GT7385@csclub.uwaterloo.ca> <20080415200647.GF4994@elf.ucw.cz> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Lennart Sorensen , Jan Kara , Bodo Eggert <7eggert@gmx.de>, Diego Calleja , Jiri Kosina , Michal Hocko , Meelis Roos , Linux Kernel list , linux-fsdevel@vger.kernel.org To: Pavel Machek Return-path: In-Reply-To: <20080415200647.GF4994@elf.ucw.cz> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2008-04-15 at 22:06 +0200, Pavel Machek wrote: > > > I'm not saying this kernel bug is likely to hit in practice. It is > > > still a kernel bug. > > > > > > Is the slowdown of lseek worth getting rid of this minor bug? Not > > > sure, probably yes. > > > > I think a slow down is the worse choice. Adding a note to the > > documentation saying that "By the way, on 32bit systems the seek call is > > not atomic for 64bit file offsets, so if you happen to issue two at > > That would be very wrong addition to documentation. If you really > wanted to do something like this, you would probably want to say > something like > > "Doing concurrent seeks on one file is undefined. Kernel may end up > with seeking to some other place." > > Unfortunately, you'd have to get this addition into POSIX standard... Is not treating the point not similar to undefined? And undefined semantics cover pretty much anything, including the current behaviour. FWIW I really think this issue is a non-issue; one cannot expect sane behaviour of unsynchronized usage of a shared resource.