]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap
authorJosef Bacik <jbacik@fb.com>
Tue, 19 May 2015 14:44:04 +0000 (10:44 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 22 May 2016 21:41:08 +0000 (14:41 -0700)
Orabug: 22617614

We should be doing this, it's weird we hadn't been doing this.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 0d2b2372e097cd3b4150d3ec91e79ac3c5cc750e)
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/extent_io.c

index c32d226bfeccbb28f25f2f417fa9e57b14411136..428930b57dc165f6422b0228eccfc21d18194675 100644 (file)
@@ -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;