Re: [PATCH 08/31] scsi: revamp host device handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/02/2021 13:23, Hannes Reinecke wrote:
  void scsi_forget_host(struct Scsi_Host *shost)
  {
-	struct scsi_device *sdev;
+	struct scsi_device *sdev, *host_sdev = NULL;
  	unsigned long flags;
restart:
  	spin_lock_irqsave(shost->host_lock, flags);
  	list_for_each_entry(sdev, &shost->__devices, siblings) {
+		if (scsi_device_is_host_dev(sdev)) {
+			host_sdev = sdev;

Is there actually a limit of 1x host_sdev always?

+			continue;
+		}
  		if (sdev->sdev_state == SDEV_DEL)
  			continue;
  		spin_unlock_irqrestore(shost->host_lock, flags);
@@ -1889,10 +1905,13 @@ void scsi_forget_host(struct Scsi_Host *shost)
  		goto restart;
  	}
  	spin_unlock_irqrestore(shost->host_lock, flags);
+	/* Remove host device last, might be needed to send commands */
+	if (host_sdev)
+		__scsi_remove_device(host_sdev);
  }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux