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. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html