* [PATCH] btrfs: fix leak of fs devices after removing btrfs module
@ 2022-12-13 10:42 fdmanana
2022-12-13 16:16 ` Josef Bacik
2022-12-13 18:47 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: fdmanana @ 2022-12-13 10:42 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
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")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/super.c | 1 +
1 file changed, 1 insertion(+)
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)
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: fix leak of fs devices after removing btrfs module
2022-12-13 10:42 [PATCH] btrfs: fix leak of fs devices after removing btrfs module fdmanana
@ 2022-12-13 16:16 ` Josef Bacik
2022-12-13 18:47 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2022-12-13 16:16 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs
On Tue, Dec 13, 2022 at 10:42:26AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: fix leak of fs devices after removing btrfs module
2022-12-13 10:42 [PATCH] btrfs: fix leak of fs devices after removing btrfs module fdmanana
2022-12-13 16:16 ` Josef Bacik
@ 2022-12-13 18:47 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2022-12-13 18:47 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs
On Tue, Dec 13, 2022 at 10:42:26AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-13 18:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-13 10:42 [PATCH] btrfs: fix leak of fs devices after removing btrfs module fdmanana
2022-12-13 16:16 ` Josef Bacik
2022-12-13 18:47 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.