From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Subject: Re: Does fsync() block read and write ops on the same file? Date: Fri, 11 Dec 2009 13:35:32 +0000 Message-ID: <82hbrxd463.fsf@mid.bfk.de> References: <82ein3npyc.fsf@mid.bfk.de> <20091211035521.GI30608@discord.disaster> <82hbrxhoxa.fsf@mid.bfk.de> <20091211124224.GK30608@discord.disaster> <20091211132133.GA18258@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Dave Chinner , linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mx01.bfk.de ([193.227.124.2]:38641 "EHLO mx01.bfk.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbZLKNfb convert rfc822-to-8bit (ORCPT ); Fri, 11 Dec 2009 08:35:31 -0500 In-Reply-To: <20091211132133.GA18258@infradead.org> (Christoph Hellwig's message of "Fri\, 11 Dec 2009 08\:21\:33 -0500") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: * Christoph Hellwig: > On Fri, Dec 11, 2009 at 11:42:24PM +1100, Dave Chinner wrote: >> No usually - normally only for data writes and metadata >> modifications. However, some filesystems >> dirty objects even on read (e.g. changing atime) and so can >> serialise on other filesystem locks (e.g. ext3 journal lock) that >> is being held by the fsync. > > Actually we also take the XFS ilock in shared mode in read, and XFS > takes it in exclusive mode if it has to update filesystem attributes > like the atime. This might be what Florian is seeing. The file system is mounted noatime. But the file in question is heavily fragmented due to the way it is created--databases pages are written in more-or-less random order, creating holes which are later filled. --=20 =46lorian Weimer BFK edv-consulting GmbH http://www.bfk.de/ Kriegsstra=DFe 100 tel: +49-721-96201-1 D-76133 Karlsruhe fax: +49-721-96201-99 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html