The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] Revert "driver: block: release the lo_work_lock before queue_work"
@ 2025-02-18  6:58 zhaoyang.huang
  2025-02-18 16:28 ` Jens Axboe
  2025-02-18 16:31 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: zhaoyang.huang @ 2025-02-18  6:58 UTC (permalink / raw)
  To: Jens Axboe, Dan Schatzberg, Ming Lei, linux-block, linux-kernel,
	Zhaoyang Huang, steve.kang

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

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>
---
 drivers/block/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 68c943a77e41..c05fe27a96b6 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -894,8 +894,8 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
 		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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-18 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18  6:58 [PATCH] Revert "driver: block: release the lo_work_lock before queue_work" zhaoyang.huang
2025-02-18 16:28 ` Jens Axboe
2025-02-18 16:31 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox