From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: how do versioning filesystems take snapshot of opened files? Date: Tue, 3 Jul 2007 09:09:46 -0400 Message-ID: <20070703090946.49e6062f@think.oraclecorp.com> References: <4ae3c140707022228u2b5098c5v766b9dc9a7e09ea1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel , linux-kernel To: "Xin Zhao" Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:45784 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754155AbXGCNKD (ORCPT ); Tue, 3 Jul 2007 09:10:03 -0400 In-Reply-To: <4ae3c140707022228u2b5098c5v766b9dc9a7e09ea1@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 3 Jul 2007 01:28:57 -0400 "Xin Zhao" wrote: > Hi, > > > If a file is already opened when snapshot command is issued, the file > itself could be in an inconsistent state already. Before the file is > closed, maybe part of the file contains old data, the rest contains > new data. > How does a versioning filesystem guarantee that the file snapshot is > in a consistent state in this case? > > I googled it but didn't find any answer. Can someone explain it a > little bit? It's the same answer as in most filesystem related questions...it depends ;) Consistent state means many different things. It may mean that the metadata accurately reflects the space on disk allocated to the file and that all data for the file is properly on disk (ie from an fsync). But, even this is less than useful because very few files on the filesystem stand alone. Applications spread their state across a number of files and so consistent means something different to every application. Getting a snapshot that is useful with respect to application data requires help from the application. The app needs to be shutdown or paused prior to the snapshot and then started up again after the snapshot is taken. -chris