Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed9e8af8 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

Btrfs: fix hole check in log_one_extent



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: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 0e30db86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}