Skip to contentSkip to conversation

scsi: scsi_debug: Drain target cleanup before module exit

PATCH Applied Giuseppe Piscitelli 2 participants 3 messages Oct 26 – Oct 31 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: scsi_debug: Drain target cleanup before module exit

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")

---
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(+)
drivers/scsi/scsi_debug.c +1 -0
index 3346562..8aa8652 100644
@@ -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

Signature · 1 line
2.54.0
maintainer Applied
#1 lore raw

Giuseppe,

Quoted 4 lines

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.

Applied to 7.4/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
maintainer Applied
#2 lore raw
In reply to Giuseppe Piscitelli
Quoted 4 lines · Giuseppe Piscitelli

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.

Applied to 7.4/scsi-queue, thanks!

[1/1] scsi: scsi_debug: Drain target cleanup before module exit

      https://git.kernel.org/mkp/scsi/c/34c99ce29939
Signature · 1 line
Martin K. Petersen