]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add assertion for empty list of transactions at late stage of umount
authorFilipe Manana <fdmanana@suse.com>
Mon, 14 Dec 2020 10:10:48 +0000 (10:10 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Dec 2020 14:00:06 +0000 (15:00 +0100)
commit9e3a9782bc677730572946f83fa7f94c6f162b21
treee3e5ba46c24517c559b495bb29a43c123f7a2358
parent5d7e3a4ffbf2ccac09a682a381a16f0e86b11e84
btrfs: add assertion for empty list of transactions at late stage of umount

Add an assertion to close_ctree(), after destroying all the work queues,
to verify we do not have any transaction still open or committing at that
at that point. If we have any, it means something is seriously wrong and
that can cause memory leaks and use-after-free problems. This is motivated
by the previous patches that fixed bugs where we ended up leaking an open
transaction after unmounting the filesystem.

Tested-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c