From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: [PATCH 1/4] vfs: vfs-level fiemap interface Date: Thu, 09 Oct 2008 14:40:17 -0600 Message-ID: <20081009204017.GP2009@webber.adilger.int> References: <1223071147-27180-1-git-send-email-tytso@mit.edu> <1223071147-27180-2-git-send-email-tytso@mit.edu> <20081004021251.GA29174@mit.edu> <48EA55AC.2060102@hp.com> <20081006210706.GB8139@mit.edu> <20081007101207.GA10406@infradead.org> <20081007130008.GA3503@shareable.org> <20081007134814.GA7311@mit.edu> <20081007234351.GA20134@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT Cc: Theodore Tso , Christoph Hellwig , jim owens , linux-fsdevel@vger.kernel.org, Mark Fasheh , Michael Kerrisk , linux-abi@vger.kernel.org To: Jamie Lokier Return-path: Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:51244 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbYJIUku (ORCPT ); Thu, 9 Oct 2008 16:40:50 -0400 In-reply-to: <20081007234351.GA20134@shareable.org> Content-disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Oct 08, 2008 00:43 +0100, Jamie Lokier wrote: > How can you safely use !(flags & FLAG_EXTENT_ENCODED) anyway in > userspace code which is filesystem-independent? What tells you that > the data isn't moved after calling FIEMAP and before unmounting, by > unrelated activity on the filesystem? > > So should filesystems also set FLAG_EXTENT_ENCODED if there is any > chance the data will move without any explicit operation on that file, > even though the data itself is stored unencoded in data blocks? The safest way of using !EXTENT_ENCODED is having a static snapshot of the filesystem so nothing can change. It is probably acceptably safe to do FIEMAP before and after a read and verify the file hasn't changed, but this is not completely foolproof. For some applications (e.g. dump) they don't even have this level of checking and are still valuable, so this is really an application/user decision IMHO. The presence of EXTENT_ENCODED just means "this is never going to work". Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.