diff mbox

[RESEND] btrfs: Don't return extent in fiemap if we meet with a hole.

Message ID 4C1F167D.3040908@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

jeff.liu June 21, 2010, 7:36 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index a4080c2..e68fd61 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3005,6 +3005,8 @@  int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 		}
 		if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))
 			flags |= FIEMAP_EXTENT_ENCODED;
+		if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
+			flags |= FIEMAP_EXTENT_UNWRITTEN;

 		emflags = em->flags;
 		free_extent_map(em);