From: Zhaoyang Huang Date: Tue, 18 Feb 2025 06:58:35 +0000 (+0800) Subject: Revert "driver: block: release the lo_work_lock before queue_work" X-Git-Tag: v6.15-rc1~166^2~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02b3c61aab443d8c1cc7d7eb0ae0a8d86b547224;p=thirdparty%2Flinux.git Revert "driver: block: release the lo_work_lock before queue_work" This reverts commit ad934fc1784802fd1408224474b25ee5289fadfc. loop_queue_work should be strictly serialized to loop_process_work since the lo_worker could be freed without noticing new work has been queued again. Signed-off-by: Zhaoyang Huang Link: https://lore.kernel.org/r/20250218065835.19503-1-zhaoyang.huang@unisoc.com Signed-off-by: Jens Axboe --- diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 68c943a77e410..c05fe27a96b64 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -894,8 +894,8 @@ queue_work: cmd_list = &lo->rootcg_cmd_list; } list_add_tail(&cmd->list_entry, cmd_list); - spin_unlock_irq(&lo->lo_work_lock); queue_work(lo->workqueue, work); + spin_unlock_irq(&lo->lo_work_lock); } static void loop_set_timer(struct loop_device *lo)