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-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0d2b2372e097cd3b4150d3ec91e79ac3c5cc750e;p=openwrt%2Fstaging%2Fblogic.git Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap We should be doing this, it's weird we hadn't been doing this. Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 856c2e8ea6ac..a3ec2c8610cc 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -4497,6 +4497,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;