From: Filipe Manana Date: Tue, 13 Dec 2022 10:42:26 +0000 (+0000) Subject: btrfs: fix leak of fs devices after removing btrfs module X-Git-Tag: v6.6.7~3585^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c68f72900a12a56c5e9890e6f2ca5119234c9a75;p=platform%2Fkernel%2Flinux-starfive.git btrfs: fix leak of fs devices after removing btrfs module When removing the btrfs module we are not calling btrfs_cleanup_fs_uuids() which results in leaking btrfs_fs_devices structures and other resources. This is a regression recently introduced by a refactoring of the module initialization and exit sequence, which simply removed the call to btrfs_cleanup_fs_uuids() in the exit path, resulting in the leaks. So fix this by calling btrfs_cleanup_fs_uuids() at exit_btrfs_fs(). Fixes: 5565b8e0adcd ("btrfs: make module init/exit match their sequence") Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 93f52ee..d5de18d 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2514,6 +2514,7 @@ static __always_inline void btrfs_exit_btrfs_fs(void) static void __exit exit_btrfs_fs(void) { btrfs_exit_btrfs_fs(); + btrfs_cleanup_fs_uuids(); } static int __init init_btrfs_fs(void)