From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ric Wheeler Subject: Re: Proposal for "proper" durable fsync() and fdatasync() Date: Tue, 26 Feb 2008 07:13:29 -0500 Message-ID: <47C40269.7060309@emc.com> References: <20080226072649.GB30238@shareable.org> <47C3C33F.1070908@garzik.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jamie Lokier , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chris Wedgwood To: Jeff Garzik Return-path: Received: from mexforward.lss.emc.com ([128.222.32.20]:35522 "EHLO mexforward.lss.emc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbYBZPOO (ORCPT ); Tue, 26 Feb 2008 10:14:14 -0500 In-Reply-To: <47C3C33F.1070908@garzik.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Jeff Garzik wrote: > Jamie Lokier wrote: >> By durable, I mean that fsync() should actually commit writes to >> physical stable storage, > > Yes, it should. > > >> I was surprised that fsync() doesn't do this already. There was a lot >> of effort put into block I/O write barriers during 2.5, so that >> journalling filesystems can force correct write ordering, using disk >> flush cache commands. >> >> After all that effort, I was very surprised to notice that Linux 2.6.x >> doesn't use that capability to ensure fsync() flushes the disk cache >> onto stable storage. > > It's surprising you are surprised, given that this [lame] fsync behavior > has remaining consistently lame throughout Linux's history. Maybe I am confused, but isn't this is what fsync() does today whenever barriers are enabled (the fsync() invalidates the drive's write cache). ric