mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: scsi_debug: Drain target cleanup before module exit
@ 2026-10-26 20:23 Giuseppe Piscitelli
  0 siblings, 0 replies; only message in thread
From: Giuseppe Piscitelli @ 2026-10-26 20:23 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, linux-kernel

Target destruction queues cleanup in an exclusive async domain. The
module loader's async_synchronize_full() does not wait for exclusive
domains. Wait for target cleanup after removing the hosts and before
removing the debugfs root and returning from module exit.

Fixes: b402a0dce64a ("scsi: scsi_debug: Fix create target debugfs failure")
Signed-off-by: Giuseppe Piscitelli <ooonea@gmail.com>
---
OpenAI Codex found this gap during SCSI teardown analysis and wrote the
fix and its local validation.

Earlier validation included a Linux 7.3 build and three ordinary
corrected-module lifecycles. No unpatched race was forced; this gap was
not established as the cause of the original allocation messages. This
base was checked for applicability; no new build or runtime test was run.

 drivers/scsi/scsi_debug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 3346562..8aa8652 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -8675,6 +8675,7 @@ static void __exit scsi_debug_exit(void)
 
 	sdebug_erase_all_stores(false);
 	xa_destroy(per_store_ap);
+	async_synchronize_full_domain(&sdebug_async_domain);
 	debugfs_remove(sdebug_debugfs_root);
 }
 
base-commit: 6a53f401e671b75c129245e371ca6e9d47fc3c9a
-- 
2.54.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-26 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 20:23 [PATCH] scsi: scsi_debug: Drain target cleanup before module exit Giuseppe Piscitelli

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

all inboxes | Powered by JetHome®