Re: [PATCH 01/14] block: remove disk_free_zone_resources()

Bart Van Assche <[email protected]> Wed, 5 Aug 2026 13:53:04 -0700
Newsgroups org.kernel.vger.linux-block
Message-ID <[email protected]>
On 8/4/26 7:27 PM, Damien Le Moal wrote:
>   destroy_pool:
>   	mempool_destroy(disk->zone_wplugs_pool);
>   	disk->zone_wplugs_pool = NULL;
> +stop_worker:
> +	kthread_stop(disk->zone_wplugs_worker);
> +	disk->zone_wplugs_worker = NULL;
>   free_hash:
>   	kfree(disk->zone_wplugs_hash);
>   	disk->zone_wplugs_hash = NULL;

With this patch applied the kernel thread and workqueue are created
after the mempool has been created. Shouldn't the kthread_stop() call
occur before the mempool_destroy() call such that the mempool is
destroyed if workqueue allocation fails?

Thanks,

Bart.