diff mbox

Btrfs: set UNWRITTEN for prealloc'ed extents in fiemap

Message ID 1432046644-6981-1-git-send-email-jbacik@fb.com (mailing list archive)
State Accepted
Headers show

Commit Message

Josef Bacik May 19, 2015, 2:44 p.m. UTC
We should be doing this, it's weird we hadn't been doing this.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 fs/btrfs/extent_io.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chris Mason May 19, 2015, 6:07 p.m. UTC | #1
On 05/19/2015 10:44 AM, Josef Bacik wrote:
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josef Bacik May 19, 2015, 7:20 p.m. UTC | #2
On 05/19/2015 02:07 PM, Chris Mason wrote:
> On 05/19/2015 10:44 AM, Josef Bacik wrote:
>> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index c32d226..428930b 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;