Re: [PATCH] btrfs: Fix block group reference leak in btrfs_repair_one_zone()
From: David Sterba
Date: Mon Sep 21 2026 - 09:13:19 EST
On Wed, Sep 16, 2026 at 05:17:16PM +0000, Wentao Liang wrote:
> btrfs_repair_one_zone() hands the block group reference taken by
> btrfs_lookup_block_group() over to relocating_repair_kthread(), which
> drops it. However the return value of kthread_run() is not checked,
> so when the kernel thread fails to spawn, nothing executes the put and
> the block group reference is leaked.
>
> Check kthread_run() and drop the reference if the thread failed to
> start.
>
> Fixes: f7ef5287a63d ("btrfs: zoned: relocate block group to repair IO failure in zoned filesystems")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Added to for-next, thanks.