Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap
PATCH 1/1 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 <[email protected]>
--- fs/btrfs/extent_io.c | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/extent_io.c +2 -0
@@ -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 ;
Signature · 1 line
1.8.3.1
Quoted 1 line · Josef Bacik
We should be doing this, it's weird we hadn't been doing this.
Isn't there an xfstest we should be failing because of this?
-chris
Quoted 5 lines · Chris Mason
Quoted 1 line · Josef Bacik
We should be doing this, it's weird we hadn't been doing this.
Isn't there an xfstest we should be failing because of this?
You'd think that but apparently the test that does my fiemap-tester specifically disables using prealloc'ed extents, so I've added another test to do the tester with prealloc, which we pass with this patch. Thanks,
Josef