Skip to contentSkip to conversation

zfcp: IO stall after path checker changes

PATCH In review Swen Schillig 3 participants 5 messages May 29, 2007 – May 30, 2007

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

PATCH 1/3 zfcp: IO stall after path checker changes

From: Michael Loehr <[email protected]>

Devices corresponding to a deleted unit are never freed. This has the effect that slave_destroy is never called and zfcp 'thinks' that this unit is still registered.
This patch changes the zfcp behaviour the way that the rport and sdev are not deleted anymore. The host is set to block on 'offline'. Host online is only removing the blocked status and everything works as expected again.

---

 drivers/s390/scsi/zfcp_aux.c  |    1 +
 drivers/s390/scsi/zfcp_ccw.c  |    5 +----
 drivers/s390/scsi/zfcp_scsi.c |    3 +++
 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/s390/scsi/zfcp_aux.c +1 -0
Index: linux_jb_patched/drivers/s390/scsi/zfcp_aux.c
===================================================================
@@ -1127,6 +1127,7 @@ zfcp_adapter_dequeue(struct zfcp_adapter
 	int retval = 0;
 	unsigned long flags;
 
+	zfcp_adapter_scsi_unregister(adapter);
 	device_unregister(&adapter->generic_services);
 	zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
 	dev_set_drvdata(&adapter->ccw_device->dev, NULL);
drivers/s390/scsi/zfcp_ccw.c +1 -4
Index: linux_jb_patched/drivers/s390/scsi/zfcp_ccw.c
===================================================================
@@ -189,9 +189,7 @@ zfcp_ccw_set_online(struct ccw_device *c
  * @ccw_device: pointer to belonging ccw device
  *
  * This function gets called by the common i/o layer and sets an adapter
- * into state offline. Setting an fcp device offline means that it will be
- * unregistered from the SCSI stack and that the adapter will be shut down
- * asynchronously.
+ * into state offline.
  */
 static int
 zfcp_ccw_set_offline(struct ccw_device *ccw_device)
@@ -202,7 +200,6 @@ zfcp_ccw_set_offline(struct ccw_device *
 	adapter = dev_get_drvdata(&ccw_device->dev);
 	zfcp_erp_adapter_shutdown(adapter, 0);
 	zfcp_erp_wait(adapter);
-	zfcp_adapter_scsi_unregister(adapter);
 	zfcp_erp_thread_kill(adapter);
 	zfcp_adapter_debug_unregister(adapter);
 	up(&zfcp_data.config_sema);
drivers/s390/scsi/zfcp_scsi.c +3 -0
Index: linux_jb_patched/drivers/s390/scsi/zfcp_scsi.c
===================================================================
@@ -569,6 +569,9 @@ zfcp_adapter_scsi_register(struct zfcp_a
 	int retval = 0;
 	static unsigned int unique_id = 0;
 
+	if (adapter->scsi_host)
+		goto out;
+
 	/* register adapter as SCSI host with mid layer of SCSI stack */
 	adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
 					     sizeof (struct zfcp_adapter *));
#1 lore raw

James

I just saw that I posted this patch on 9th already,
but todays git pull from your tree didn't show the inclusion of this one (and another patch posted the same day). Event though it's reported in your summary from the 26 !
If I'm to quick then I'm sorry for sending it twice, if there's any other
reason for this patch to not be included please let me know.

Thanks
Swen

Quoted 70 lines · Swen Schillig

From: Michael Loehr <[email protected]>

Devices corresponding to a deleted unit are never freed. This has the effect that slave_destroy is never called and zfcp 'thinks' that this unit is still registered.
This patch changes the zfcp behaviour the way that the rport and sdev are not deleted anymore. The host is set to block on 'offline'. Host online is only removing the blocked status and everything works as expected again.

---

 drivers/s390/scsi/zfcp_aux.c  |    1 +
 drivers/s390/scsi/zfcp_ccw.c  |    5 +----
 drivers/s390/scsi/zfcp_scsi.c |    3 +++
 3 files changed, 5 insertions(+), 4 deletions(-)

Index: linux_jb_patched/drivers/s390/scsi/zfcp_aux.c
===================================================================

drivers/s390/scsi/zfcp_aux.c +1 -0
@@ -1127,6 +1127,7 @@ zfcp_adapter_dequeue(struct zfcp_adapter
 	int retval = 0;
 	unsigned long flags;
 
+	zfcp_adapter_scsi_unregister(adapter);
 	device_unregister(&adapter->generic_services);
 	zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
 	dev_set_drvdata(&adapter->ccw_device->dev, NULL);

Index: linux_jb_patched/drivers/s390/scsi/zfcp_ccw.c
===================================================================

drivers/s390/scsi/zfcp_ccw.c +1 -4
@@ -189,9 +189,7 @@ zfcp_ccw_set_online(struct ccw_device *c
  * @ccw_device: pointer to belonging ccw device
  *
  * This function gets called by the common i/o layer and sets an adapter
- * into state offline. Setting an fcp device offline means that it will be
- * unregistered from the SCSI stack and that the adapter will be shut down
- * asynchronously.
+ * into state offline.
  */
 static int
 zfcp_ccw_set_offline(struct ccw_device *ccw_device)
@@ -202,7 +200,6 @@ zfcp_ccw_set_offline(struct ccw_device *
 	adapter = dev_get_drvdata(&ccw_device->dev);
 	zfcp_erp_adapter_shutdown(adapter, 0);
 	zfcp_erp_wait(adapter);
-	zfcp_adapter_scsi_unregister(adapter);
 	zfcp_erp_thread_kill(adapter);
 	zfcp_adapter_debug_unregister(adapter);
 	up(&zfcp_data.config_sema);

Index: linux_jb_patched/drivers/s390/scsi/zfcp_scsi.c
===================================================================

drivers/s390/scsi/zfcp_scsi.c +3 -0
@@ -569,6 +569,9 @@ zfcp_adapter_scsi_register(struct zfcp_a
 	int retval = 0;
 	static unsigned int unique_id = 0;
 
+	if (adapter->scsi_host)
+		goto out;
+
 	/* register adapter as SCSI host with mid layer of SCSI stack */
 	adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
 					     sizeof (struct zfcp_adapter *));
#2 lore raw
Quoted 5 lines · Swen Schillig

I just saw that I posted this patch on 9th already,
but todays git pull from your tree didn't show the inclusion of this one (and another patch posted the same day). Event though it's reported in your summary from the 26 !
If I'm to quick then I'm sorry for sending it twice, if there's any other
reason for this patch to not be included please let me know.

Sorry ... must have missed it. I'll add it to rc-fixes (unfortunately I need linus to pull before I can push into this tree, so there'll be a slight delay).

James

#3 lore raw
Quoted 10 lines · James Bottomley
Quoted 5 lines · Swen Schillig

I just saw that I posted this patch on 9th already,
but todays git pull from your tree didn't show the inclusion of this one (and another patch posted the same day). Event though it's reported in your summary from the 26 !
If I'm to quick then I'm sorry for sending it twice, if there's any other
reason for this patch to not be included please let me know.

Sorry ... must have missed it. I'll add it to rc-fixes (unfortunately I need linus to pull before I can push into this tree, so there'll be a slight delay).

Actually, forget that; this is it, isn't it?

http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;a=commit;h=9f28745a6b554fdd6b0dbc9856077701a55f9569

In which case it's awaiting a pull into Linus' tree head.

James

#4 lore raw
Quoted 12 lines · James Bottomley
Quoted 10 lines · James Bottomley
Quoted 5 lines · Swen Schillig

I just saw that I posted this patch on 9th already,
but todays git pull from your tree didn't show the inclusion of this one (and another patch posted the same day). Event though it's reported in your summary from the 26 !
If I'm to quick then I'm sorry for sending it twice, if there's any other
reason for this patch to not be included please let me know.

Sorry ... must have missed it. I'll add it to rc-fixes (unfortunately I need linus to pull before I can push into this tree, so there'll be a slight delay).

Quoted 9 lines

Actually, forget that; this is it, isn't it?

http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;a=commit;h=9f28745a6b554fdd6b0dbc9856077701a55f9569

In which case it's awaiting a pull into Linus' tree head.

James

Yeah, that's it.

Thanks.

Swen