Skip to contentSkip to conversation

zfcp fixes for scsi-misc

PATCH New Christof Schmitt 1 participant 4 messages Oct 5, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover zfcp fixes for scsi-misc

James,

here are three small zfcp bug fixes for the scsi-misc tree.

--
Christof

#1 lore raw

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
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c
@@ -532,9 +532,6 @@ static void zfcp_fsf_exchange_config_dat
 		fc_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;
#2 lore raw

PATCH 2/3 zfcp: Call get_device on port before calling put_device

In reply to Christof Schmitt

From: 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
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_unit.c linux-2.6-patched/drivers/s390/scsi/zfcp_unit.c
@@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *port
 		return -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 *port
 		return -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);
#3 lore raw

PATCH 3/3 zfcp: Use correct length for FCP_RSP_INFO

In reply to Christof Schmitt

From: 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
diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fc.h linux-2.6-patched/drivers/s390/scsi/zfcp_fc.h
@@ -270,7 +270,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_res
 	if (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);