zfcp fixes for scsi-misc
Subsystems (3)
cover zfcp fixes for scsi-misc
James,
here are three small zfcp bug fixes for the scsi-misc tree.
--
Christof
PATCH 1/3 zfcp: Fix adapter activation on link down
From: Swen Schillig <[email protected]>
If an exchange config is executed while the local link is down, the request succeeds but the returned data is incomplete. Proceeding with the adapter activation is leading to an unpredictable behaviour (e.g. kernel panic) caused by invalid values. In such a scenario the recommended ERP is to retry the action and wait for a link up event. If the issue persists the activation has to fail.
---
drivers/s390/scsi/zfcp_fsf.c | 3 --- 1 file changed, 3 deletions(-)
drivers/s390/scsi/zfcp_fsf.c +0 -3
@@ -532,9 +532,6 @@ static void zfcp_fsf_exchange_config_datfc_host_port_type (shost) =FC_PORTTYPE_UNKNOWN ; adapter->hydra_version =0 ; -atomic_set_mask (ZFCP_STATUS_ADAPTER_XCONFIG_OK , - &adapter->status); -zfcp_fsf_link_down_info_eval (req, &qtcb->header.fsf_status_qual.link_down_info);break ;
PATCH 2/3 zfcp: Call get_device on port before calling put_device
In reply to Christof SchmittFrom: Christof Schmitt <[email protected]>
zfcp_unit_release calls put_device on the port. Ensure that get_device has been called before possibly triggering the release function through put_device or device_unregister.
---
drivers/s390/scsi/zfcp_unit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/scsi/zfcp_unit.c +2 -2
@@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *portreturn -ENOMEM ; } +get_device (&port->dev); +if (device_register (&unit->dev)) {put_device (&unit->dev);return -ENOMEM ;
@@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *portreturn -EINVAL ; } -get_device (&port->dev); -write_lock_irq (&port->unit_list_lock);list_add_tail (&unit->list, &port->unit_list);write_unlock_irq (&port->unit_list_lock);
PATCH 3/3 zfcp: Use correct length for FCP_RSP_INFO
In reply to Christof SchmittFrom: Christof Schmitt <[email protected]>
Use the FCP_RSP_INFO length to correctly skip the FCP_RSP_INFO field.
---
drivers/s390/scsi/zfcp_fc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/scsi/zfcp_fc.h +1 -1
@@ -270,7 +270,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resif (unlikely (rsp_flags &FCP_SNS_LEN_VAL )) { sense = (char *) &fcp_rsp[1 ];if (rsp_flags &FCP_RSP_LEN_VAL ) - sense += fcp_rsp->ext.fr_sns_len; + sense += fcp_rsp->ext.fr_rsp_len; sense_len =min (fcp_rsp->ext.fr_sns_len, (u32 )SCSI_SENSE_BUFFERSIZE );memcpy (scsi->sense_buffer, sense, sense_len);