[Devel] [PATCH hci-8.1 v2 2/4] dm-ploop: fix a lost wakeup of the ploop_allocator() thread
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Nov 4 21:59:53 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> ploop_allocator() tests prealloc_size and only then sets itself
> TASK_INTERRUPTIBLE before schedule(). A request that lands between the
> two finds the thread still running, so wake_up_process() does nothing,
> and the thread goes to sleep with the request pending. A pio whose
> cluster is past the end of the top delta then waits in
> ploop_allocate_cluster() for good: ploop_req_prealloc() does not wake
> the thread for a size already requested, so later requests do not end
> the stall either. The dispatcher waits for every runner to go idle
> before it hands out more work, so the whole device stalls.
>
> The thread tests kthread_should_stop() before setting the task state
> too, so a kthread_stop() is lost the same way and the removal of the
> device hangs.
>
> Set the task state before testing prealloc_size and
> kthread_should_stop().
>
> Fixes: cf489cf22cd5 ("dm-ploop: make filespace preallocations async")
> Reported-by: Konstantin Khorenko <khorenko at virtuozzo.com>
> https://virtuozzo.atlassian.net/browse/VSTOR-152984
> Feature: dm-ploop: ploop target driver
> Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
> Reviewed-by: Konstantin Khorenko <khorenko at virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261104185519.1870488-1-den@openvz.org?part=2
More information about the Devel
mailing list