lkml.org 
[lkml]   [2010]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfiemap is broken for sparse file in ext4?
Hi Ted and other ext4 gurus,
I found fiemap may be broken for sparse files in ext4. Here is a simple
example.

dd if=/dev/zero of=testfile1 bs=1M count=1
using fiemap shows that it has a delalloc extent.
Logical: 0 Ext length: 1048576 Physical: 0 flags: 7

flags 7 means FIEMAP_EXTENT_LAST, FIEMAP_EXTENT_UNKNOWN and
FIEMAP_EXTENT_DELALLOC,

while if we create a sparse file, fiemap will not show the delalloc extent.
dd if=/dev/zero of=testfile1 bs=1M count=1 seek=1
using fiemap shows that it has no extent for the file. while we should
have some output like:
Logical: 1048576 Ext length: 1048576 Physical: 0 flags: 7

So we have different output with sparse and non-sparse file. Is it a bug
for ext4?

Regards,
Tao


\
 
 \ /
  Last update: 2010-06-11 04:19    [W:0.050 / U:1.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site