]> www.infradead.org Git - users/hch/misc.git/commitdiff
Revert "driver: block: release the lo_work_lock before queue_work"
authorZhaoyang Huang <zhaoyang.huang@unisoc.com>
Tue, 18 Feb 2025 06:58:35 +0000 (14:58 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 18 Feb 2025 16:28:26 +0000 (09:28 -0700)
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 <zhaoyang.huang@unisoc.com>
Link: https://lore.kernel.org/r/20250218065835.19503-1-zhaoyang.huang@unisoc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index 68c943a77e410c39da7f0c5a5090a5324a1e3cab..c05fe27a96b64f1f1ea3868510fdd0c7f4937f55 100644 (file)
@@ -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)