diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2006-05-22 12:25:56 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-05-28 12:50:17 -0400 |
commit | 338151e066084d92d89f44311e5521ef847a50b9 (patch) | |
tree | 5783d26710203f2c5b309530334f3dd39ca68dfc /drivers/s390/scsi | |
parent | 75bfc2837bbcc329193d51e8b7115184b78beae0 (diff) |
[SCSI] zfcp: make use of fc_remote_port_delete when target port is unavailable
If zfcp's port erp fails we now call fc_remote_port_delete. This helps
to avoid offlined scsi devices if scsi commands time out due to path
failures. When an adapter erp fails we call fc_remote_port_delete for
all ports on that adapter.
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 22 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 7 |
3 files changed, 27 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 05c47f6ca924..4682c8b8bd24 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -3241,9 +3241,13 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, | |||
3241 | break; | 3241 | break; |
3242 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 3242 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
3243 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 3243 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
3244 | if (atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, | ||
3245 | &port->status)) { | ||
3246 | zfcp_port_put(port); | ||
3247 | break; | ||
3248 | } | ||
3249 | |||
3244 | if ((result == ZFCP_ERP_SUCCEEDED) | 3250 | if ((result == ZFCP_ERP_SUCCEEDED) |
3245 | && !atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, | ||
3246 | &port->status) | ||
3247 | && !port->rport) { | 3251 | && !port->rport) { |
3248 | struct fc_rport_identifiers ids; | 3252 | struct fc_rport_identifiers ids; |
3249 | ids.node_name = port->wwnn; | 3253 | ids.node_name = port->wwnn; |
@@ -3264,9 +3268,23 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, | |||
3264 | port->supported_classes; | 3268 | port->supported_classes; |
3265 | } | 3269 | } |
3266 | } | 3270 | } |
3271 | if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { | ||
3272 | fc_remote_port_delete(port->rport); | ||
3273 | port->rport = NULL; | ||
3274 | } | ||
3267 | zfcp_port_put(port); | 3275 | zfcp_port_put(port); |
3268 | break; | 3276 | break; |
3269 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 3277 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
3278 | if (result != ZFCP_ERP_SUCCEEDED) { | ||
3279 | struct zfcp_port *port; | ||
3280 | list_for_each_entry(port, &adapter->port_list_head, list) | ||
3281 | if (port->rport && | ||
3282 | !atomic_test_mask(ZFCP_STATUS_PORT_WKA, | ||
3283 | &port->status)) { | ||
3284 | fc_remote_port_delete(port->rport); | ||
3285 | port->rport = NULL; | ||
3286 | } | ||
3287 | } | ||
3270 | zfcp_adapter_put(adapter); | 3288 | zfcp_adapter_put(adapter); |
3271 | break; | 3289 | break; |
3272 | default: | 3290 | default: |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index ab38b8ce27aa..d02366004cdd 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -132,8 +132,6 @@ extern int zfcp_scsi_command_async(struct zfcp_adapter *,struct zfcp_unit *, | |||
132 | struct scsi_cmnd *, struct timer_list *); | 132 | struct scsi_cmnd *, struct timer_list *); |
133 | extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, | 133 | extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, |
134 | struct timer_list *); | 134 | struct timer_list *); |
135 | extern void zfcp_set_fc_host_attrs(struct zfcp_adapter *); | ||
136 | extern void zfcp_set_fc_rport_attrs(struct zfcp_port *); | ||
137 | extern struct scsi_transport_template *zfcp_transport_template; | 135 | extern struct scsi_transport_template *zfcp_transport_template; |
138 | extern struct fc_function_template zfcp_transport_functions; | 136 | extern struct fc_function_template zfcp_transport_functions; |
139 | 137 | ||
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 30e87197f5f8..46e14f22ec18 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -800,12 +800,18 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost) | |||
800 | } | 800 | } |
801 | } | 801 | } |
802 | 802 | ||
803 | static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout) | ||
804 | { | ||
805 | rport->dev_loss_tmo = timeout; | ||
806 | } | ||
807 | |||
803 | struct fc_function_template zfcp_transport_functions = { | 808 | struct fc_function_template zfcp_transport_functions = { |
804 | .show_starget_port_id = 1, | 809 | .show_starget_port_id = 1, |
805 | .show_starget_port_name = 1, | 810 | .show_starget_port_name = 1, |
806 | .show_starget_node_name = 1, | 811 | .show_starget_node_name = 1, |
807 | .show_rport_supported_classes = 1, | 812 | .show_rport_supported_classes = 1, |
808 | .show_rport_maxframe_size = 1, | 813 | .show_rport_maxframe_size = 1, |
814 | .show_rport_dev_loss_tmo = 1, | ||
809 | .show_host_node_name = 1, | 815 | .show_host_node_name = 1, |
810 | .show_host_port_name = 1, | 816 | .show_host_port_name = 1, |
811 | .show_host_permanent_port_name = 1, | 817 | .show_host_permanent_port_name = 1, |
@@ -815,6 +821,7 @@ struct fc_function_template zfcp_transport_functions = { | |||
815 | .show_host_serial_number = 1, | 821 | .show_host_serial_number = 1, |
816 | .get_fc_host_stats = zfcp_get_fc_host_stats, | 822 | .get_fc_host_stats = zfcp_get_fc_host_stats, |
817 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, | 823 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, |
824 | .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, | ||
818 | /* no functions registered for following dynamic attributes but | 825 | /* no functions registered for following dynamic attributes but |
819 | directly set by LLDD */ | 826 | directly set by LLDD */ |
820 | .show_host_port_type = 1, | 827 | .show_host_port_type = 1, |