Skip to contentSkip to conversation

Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap

PATCH In review Josef Bacik 2 participants 3 messages May 19, 2015 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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.

---
 fs/btrfs/extent_io.c | 2 ++
 1 file changed, 2 insertions(+)
fs/btrfs/extent_io.c +2 -0
index c32d226..428930b 100644
@@ -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
#1 lore raw
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

#2 lore raw
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