]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: fix incorrect block_len in merge_extent_mapping
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 19 Dec 2017 22:42:54 +0000 (15:42 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 1 Feb 2018 23:34:32 +0000 (15:34 -0800)
commitf1fd0969b3179879d3502dc6ee8e9f7d07eca332
treea94fc3f048d0965aa3fd4c99c37b993ae242259b
parente2a2af61bf91599257476b10009f21fd8b127613
Btrfs: fix incorrect block_len in merge_extent_mapping

Orabug: 27446668

%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.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
fs/btrfs/inode.c