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

Message ID 4C1F167D.3040908@oracle.com
State New, archived
Headers show

Commit Message

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

Patch
diff mbox

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);