Skip to contentSkip to conversation

csiostor:Fix error handling in the function csio_device_reset

PATCH RESEND Hannes Reinecke 1 participant 1 message Sep 16, 2015 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 27 lines · Nicholas Krause

This fixes error handling in the function csio_device_reset to check the return value of aftering the function csio_hw_reset to check if it returned a error code and if so unlock the irq spinlock for the hardware plus return the hardware error code immediately.

---
 drivers/scsi/csiostor/csio_scsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/csiostor/csio_scsi.c +1 -0
index 2c4562d..faea4e7 100644
@@ -1378,6 +1378,7 @@ csio_device_reset(struct device *dev,
 {
 	struct csio_lnode *ln = shost_priv(class_to_shost(dev));
 	struct csio_hw *hw = csio_lnode_to_hw(ln);
+	int ret;
 
 	if (*buf != '1')
 		return -EINVAL;
@@ -1389,7 +1390,11 @@ csio_device_reset(struct device *dev,
 	csio_lnodes_block_request(hw);
 

drivers/scsi/csiostor/csio_scsi.c csio_device_reset(struct device *dev, · line 1400

Quoted 10 lines
drivers/scsi/csiostor/csio_scsi.c +5 -1
 	spin_lock_irq(&hw->lock);
-	csio_hw_reset(hw);
+	ret = csio_hw_reset(hw);
+	if (ret) {
+			spin_unlock_irq(&hw->lock);
+			return ret;
+	}
 	spin_unlock_irq(&hw->lock);
 
 	/* Unblock upper IOs */

No sure if that is correct; wouldn't the device stay blocked if csio_hw_reset() fails?

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)