From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: Update of file offset on write() etc. is non-atomic with I/O Date: Thu, 20 Feb 2014 18:29:32 +0000 Message-ID: <20140220182932.GF18016@ZenIV.linux.org.uk> References: <8e9349a1-d900-4c93-8dad-1e32f26529c2@blur> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Linus Torvalds , "Michael Kerrisk (man-pages)" , lkml , Miklos Szeredi , Theodore T'so , Christoph Hellwig , Chris Mason , Dave Chinner , Linux-Fsdevel , "J. Bruce Fields" , Yongzhi Pan To: "Zuckerman, Boris" Return-path: Content-Disposition: inline In-Reply-To: <8e9349a1-d900-4c93-8dad-1e32f26529c2@blur> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Feb 20, 2014 at 06:15:15PM +0000, Zuckerman, Boris wrote: > Hi, >=20 > You probably already considered that - sorry, if so=E2=80=A6 >=20 > Instead of the mutex Windows use ExecutiveResource with shared and ex= clusive semantics. Readers serialize by taking the resource shared and = writers take it exclusive. I have that implemented for Linux. Please, l= et me know if there is any interest! See include/linux/rwsem.h... Anyway, the really interesting question here is what does POSIX promise wrt lseek() vs. write(). What warranties are given there?