From: Josef Bacik Date: Tue, 19 May 2015 14:44:04 +0000 (-0400) Subject: Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap X-Git-Tag: v4.1.12-92~162^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fdbc7938ccc5c66b83167a0821cd33aa6aa2a403;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c32d226bfecc..428930b57dc1 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;