Btrfs: fix hole check in log_one_extent
authorJosef Bacik <jbacik@fusionio.com>
Mon, 14 Oct 2013 21:23:08 +0000 (17:23 -0400)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 02:58:32 +0000 (21:58 -0500)
I added an assert to make sure we were looking up aligned offsets for csums and
I tripped it when running xfstests.  This is because log_one_extent was checking
if block_start == 0 for a hole instead of EXTENT_MAP_HOLE.  This worked out fine
in practice it seems, but it adds a lot of extra work that is uneeded.  With
this fix I'm no longer tripping my assert.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/tree-log.c

index 849b72985c7414f3f756c0ba05c02b9de9cfeed8..1134aa40b6d1f83bb658bdf7d2b7bad61151a8c5 100644 (file)
@@ -3373,7 +3373,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
                btrfs_set_token_file_extent_type(leaf, fi,
                                                 BTRFS_FILE_EXTENT_REG,
                                                 &token);
-               if (em->block_start == 0)
+               if (em->block_start == EXTENT_MAP_HOLE)
                        skip_csum = true;
        }