btrfs: Add a test for leaking root crash at unmount time
authorQu Wenruo <wqu@suse.com>
Wed, 20 May 2020 11:44:42 +0000 (19:44 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 24 May 2020 16:12:27 +0000 (00:12 +0800)
commita297366f56213aa29790419e8edda47edb8347ba
treec58d5917d27ddf332d6637a8259b0acde8b44b4d
parent2efe93a3be1fcdc17d4de6da5e69e7337438b703
btrfs: Add a test for leaking root crash at unmount time

Test if canceled balance could lead to root leakage.
If the kernel has CONFIG_BTRFS_DEBUG compiled, unmount time root leakge
check would detect it, and cause NULL pointer dereference as the pages
of the leaked root are already freed.

The fix is titled "btrfs: relocation: Fix reloc root leakage and the NULL
 pointer reference caused by the leakage".

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/212 [new file with mode: 0755]
tests/btrfs/212.out [new file with mode: 0644]
tests/btrfs/group