From fdbc7938ccc5c66b83167a0821cd33aa6aa2a403 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 19 May 2015 10:44:04 -0400 Subject: [PATCH] Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap Orabug: 22617614 We should be doing this, it's weird we hadn't been doing this. Signed-off-by: Josef Bacik Signed-off-by: Chris Mason (cherry picked from commit 0d2b2372e097cd3b4150d3ec91e79ac3c5cc750e) Signed-off-by: Liu Bo --- fs/btrfs/extent_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c32d226bfeccb..428930b57dc16 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4492,6 +4492,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; free_extent_map(em); em = NULL; -- 2.50.1