]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/s390/scsi/zfcp_scsi.c
Merge tag 'spdx_identifiers-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / drivers / s390 / scsi / zfcp_scsi.c
index 0678cf714c0ee6060eb10e80c3a7c05f6a21f1d2..4d2ba5682493221bf32f0c4000021da54dc57044 100644 (file)
@@ -1,9 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * zfcp device driver
  *
  * Interface to Linux SCSI midlayer.
  *
- * Copyright IBM Corp. 2002, 2016
+ * Copyright IBM Corp. 2002, 2017
  */
 
 #define KMSG_COMPONENT "zfcp"
@@ -28,7 +29,7 @@ static bool enable_dif;
 module_param_named(dif, enable_dif, bool, 0400);
 MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support");
 
-static bool allow_lun_scan = 1;
+static bool allow_lun_scan = true;
 module_param(allow_lun_scan, bool, 0600);
 MODULE_PARM_DESC(allow_lun_scan, "For NPIV, scan and attach all storage LUNs");
 
@@ -115,10 +116,15 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
        struct zfcp_unit *unit;
        int npiv = adapter->connection_features & FSF_FEATURE_NPIV_MODE;
 
+       zfcp_sdev->erp_action.adapter = adapter;
+       zfcp_sdev->erp_action.sdev = sdev;
+
        port = zfcp_get_port_by_wwpn(adapter, rport->port_name);
        if (!port)
                return -ENXIO;
 
+       zfcp_sdev->erp_action.port = port;
+
        unit = zfcp_unit_find(port, zfcp_scsi_dev_lun(sdev));
        if (unit)
                put_device(&unit->dev);
@@ -273,25 +279,29 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags)
 
                zfcp_erp_wait(adapter);
                ret = fc_block_scsi_eh(scpnt);
-               if (ret)
+               if (ret) {
+                       zfcp_dbf_scsi_devreset("fiof", scpnt, tm_flags, NULL);
                        return ret;
+               }
 
                if (!(atomic_read(&adapter->status) &
                      ZFCP_STATUS_COMMON_RUNNING)) {
-                       zfcp_dbf_scsi_devreset("nres", scpnt, tm_flags);
+                       zfcp_dbf_scsi_devreset("nres", scpnt, tm_flags, NULL);
                        return SUCCESS;
                }
        }
-       if (!fsf_req)
+       if (!fsf_req) {
+               zfcp_dbf_scsi_devreset("reqf", scpnt, tm_flags, NULL);
                return FAILED;
+       }
 
        wait_for_completion(&fsf_req->completion);
 
        if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) {
-               zfcp_dbf_scsi_devreset("fail", scpnt, tm_flags);
+               zfcp_dbf_scsi_devreset("fail", scpnt, tm_flags, fsf_req);
                retval = FAILED;
        } else {
-               zfcp_dbf_scsi_devreset("okay", scpnt, tm_flags);
+               zfcp_dbf_scsi_devreset("okay", scpnt, tm_flags, fsf_req);
                zfcp_scsi_forget_cmnds(zfcp_sdev, tm_flags);
        }