Skip to content

Commit eebeb88

Browse files
Liu BoSomasundaram Krishnasamy
authored andcommitted
Btrfs: fix incorrect block_len in merge_extent_mapping
Orabug: 27446653 %block_len could be checked on deciding if two em are mergable. merge_extent_mapping() has only added the front pad if the front part of em gets truncated, but it's possible that the end part gets truncated. For both compressed extent and inline extent, em->block_len is not adjusted accordingly, while for regular extent, em->block_len always equals to em->len, hence this sets em->block_len with em->len. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 7996101 commit eebeb88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6906,7 +6906,7 @@ static int merge_extent_mapping(struct extent_map_tree *em_tree,
69066906
if (em->block_start < EXTENT_MAP_LAST_BYTE &&
69076907
!test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) {
69086908
em->block_start += start_diff;
6909-
em->block_len -= start_diff;
6909+
em->block_len = em->len;
69106910
}
69116911
return add_extent_mapping(em_tree, em, 0);
69126912
}

0 commit comments

Comments
 (0)