diff options
| author | Ming Lei <[email protected]> | 2022-07-28 15:18:49 -0700 |
|---|---|---|
| committer | Martin K. Petersen <[email protected]> | 2022-08-01 19:45:14 -0400 |
| commit | 16728aaba62e8b3b170735fdc3d8aa972835c136 (patch) | |
| tree | 126c11cb5076d3a1b8d6cb2aeda76799be6940d5 /include | |
| parent | fe442604199ed3e60d5411137159f9623534e956 (diff) | |
scsi: core: Make sure that hosts outlive targets
Fix the race conditions between SCSI LLD kernel module unloading and SCSI
device and target removal by making sure that SCSI hosts are destroyed
after all associated target and device objects have been freed.
Link: https://lore.kernel.org/r/[email protected]
Cc: Christoph Hellwig <[email protected]>
Cc: Ming Lei <[email protected]>
Cc: Mike Christie <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: John Garry <[email protected]>
Reviewed-by: Mike Christie <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
[ bvanassche: Reworked Ming's patch and split it ]
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/scsi/scsi_host.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 667d889b92b5..339f975d356e 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -689,6 +689,9 @@ struct Scsi_Host { /* ldm bits */ struct device shost_gendev, shost_dev; + atomic_t target_count; + wait_queue_head_t targets_wq; + /* * Points to the transport data (if any) which is allocated * separately |