Skip to content

Commit c68f729

Browse files
fdmananakdave
authored andcommitted
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: 5565b8e ("btrfs: make module init/exit match their sequence") Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent db0a4a7 commit c68f729

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,6 +2514,7 @@ static __always_inline void btrfs_exit_btrfs_fs(void)
25142514
static void __exit exit_btrfs_fs(void)
25152515
{
25162516
btrfs_exit_btrfs_fs();
2517+
btrfs_cleanup_fs_uuids();
25172518
}
25182519

25192520
static int __init init_btrfs_fs(void)

0 commit comments

Comments
 (0)