diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-12-13 11:42:26 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-15 19:16:54 +0100 |
commit | c68f72900a12a56c5e9890e6f2ca5119234c9a75 (patch) | |
tree | 9db2e272a61a40fa26783b2469d7696695640a5e /fs | |
parent | btrfs: fix an error handling path in btrfs_defrag_leaves() (diff) | |
download | linux-c68f72900a12a56c5e9890e6f2ca5119234c9a75.tar.xz linux-c68f72900a12a56c5e9890e6f2ca5119234c9a75.zip |
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 <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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 93f52ee85f6f..d5de18d6517e 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) |