]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix incorrect block_len in merge_extent_mapping
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 5 Jan 2018 19:51:08 +0000 (12:51 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:21 +0000 (16:08 +0100)
commite5a8a1296109ea404518c7e765e7283d7eb89903
tree6f865743331bbeeba4babc96f23fe2229d17accc
parent2e02bc9bd44d11013543f53283cef50418d57fb2
Btrfs: fix incorrect block_len in merge_extent_mapping

%block_len could be checked on deciding if two em are mergeable.

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, and for regular extent, em->block_len always
equals to em->len, hence this sets em->block_len with em->len.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c