scsi: hpsa: correct device id issues
authorDon Brace <don.brace@microsemi.com>
Tue, 12 Mar 2019 18:11:39 +0000 (13:11 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 18 Mar 2019 20:46:14 +0000 (16:46 -0400)
Correct a 'rare' race condition where a disk is failed after a device list
has been obtained from the controller and before attempting to get the
device id.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c

index f311ab259a02e494529a454f1629d92675158054..bd98a9667ce4b3ad848ce1da5ae1a3ec582e82ea 100644 (file)
@@ -3967,14 +3967,18 @@ static int hpsa_update_device_info(struct ctlr_info *h,
        memset(this_device->device_id, 0,
                sizeof(this_device->device_id));
        if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
-               sizeof(this_device->device_id)) < 0)
+               sizeof(this_device->device_id)) < 0) {
                dev_err(&h->pdev->dev,
-                       "hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n",
+                       "hpsa%d: %s: can't get device id for [%d:%d:%d:%d]\t%s\t%.16s\n",
                        h->ctlr, __func__,
                        h->scsi_host->host_no,
-                       this_device->target, this_device->lun,
+                       this_device->bus, this_device->target,
+                       this_device->lun,
                        scsi_device_type(this_device->devtype),
                        this_device->model);
+               rc = HPSA_LV_FAILED;
+               goto bail_out;
+       }
 
        if ((this_device->devtype == TYPE_DISK ||
                this_device->devtype == TYPE_ZBC) &&