]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make tree checker detect checksum items with overlapping ranges
authorFilipe Manana <fdmanana@suse.com>
Mon, 2 Dec 2019 11:01:03 +0000 (11:01 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 13 Dec 2019 13:09:25 +0000 (14:09 +0100)
commitc1c8455b8ee2466d788524628827db29fb54448e
treef6ed5e33639d053fd38827d2c2c12d6d8bbbbfe7
parent249e05f51be5ddad8367a4a1b964549d2fe5b28a
Btrfs: make tree checker detect checksum items with overlapping ranges

Having checksum items, either on the checksums tree or in a log tree, that
represent ranges that overlap each other is a sign of a corruption. Such
case confuses the checksum lookup code and can result in not being able to
find checksums or find stale checksums.

So add a check for such case.

This is motivated by a recent fix for a case where a log tree had checksum
items covering ranges that overlap each other due to extent cloning, and
resulted in missing checksums after replaying the log tree. It also helps
detect past issues such as stale and outdated checksums due to overlapping,
commit cf752fb4fab2a9 ("Btrfs: fix csum tree corruption, duplicate and
outdated checksums").

CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-checker.c