Commit 9cabe637 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by James Bottomley

[PATCH] zfcp: act enhancements corrections

- corrects errors introduced in open_unit_handler
  with last patch submission for act enhancements,
- changes formatting and some log-messages in act
  enhancments code,
- removes junk lines
- corrected Kconfig dependency for zfcp
- do not wait for SBALs when creating ELS requests
Signed-off-by: default avatarAndreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 086b29f0
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
#ifndef ZFCP_DEF_H #ifndef ZFCP_DEF_H
#define ZFCP_DEF_H #define ZFCP_DEF_H
/* this drivers version (do not edit !!! generated and updated by cvs) */ #define ZFCP_DEF_REVISION "$Revision: 1.111 $"
#define ZFCP_DEF_REVISION "$Revision: 1.110 $"
/*************************** INCLUDES *****************************************/ /*************************** INCLUDES *****************************************/
...@@ -70,6 +69,7 @@ ...@@ -70,6 +69,7 @@
/********************* GENERAL DEFINES *********************************/ /********************* GENERAL DEFINES *********************************/
/* zfcp version number, it consists of major, minor, and patch-level number */
#define ZFCP_VERSION "4.2.0" #define ZFCP_VERSION "4.2.0"
/** /**
......
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP #define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP
/* this drivers version (do not edit !!! generated and updated by cvs) */ #define ZFCP_ERP_REVISION "$Revision: 1.85 $"
#define ZFCP_ERP_REVISION "$Revision: 1.83 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -3482,9 +3481,8 @@ zfcp_erp_port_access_denied(struct zfcp_port *port) ...@@ -3482,9 +3481,8 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
debug_text_event(adapter->erp_dbf, 3, "p_access_block"); debug_text_event(adapter->erp_dbf, 3, "p_access_block");
debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
read_lock_irqsave(&zfcp_data.config_lock, flags); read_lock_irqsave(&zfcp_data.config_lock, flags);
zfcp_erp_modify_port_status(port, zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED |
ZFCP_STATUS_COMMON_ERP_FAILED | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET);
ZFCP_SET);
read_unlock_irqrestore(&zfcp_data.config_lock, flags); read_unlock_irqrestore(&zfcp_data.config_lock, flags);
} }
...@@ -3500,9 +3498,8 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit) ...@@ -3500,9 +3498,8 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
debug_text_event(adapter->erp_dbf, 3, "u_access_block"); debug_text_event(adapter->erp_dbf, 3, "u_access_block");
debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
zfcp_erp_modify_unit_status(unit, zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_ERP_FAILED |
ZFCP_STATUS_COMMON_ERP_FAILED | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET);
ZFCP_SET);
} }
/* /*
...@@ -3541,19 +3538,21 @@ zfcp_erp_port_access_changed(struct zfcp_port *port) ...@@ -3541,19 +3538,21 @@ zfcp_erp_port_access_changed(struct zfcp_port *port)
debug_text_event(adapter->erp_dbf, 3, "p_access_unblock"); debug_text_event(adapter->erp_dbf, 3, "p_access_unblock");
debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status)) { if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
&port->status)) {
if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
list_for_each_entry(unit, &port->unit_list_head, list) list_for_each_entry(unit, &port->unit_list_head, list)
zfcp_erp_unit_access_changed(unit); zfcp_erp_unit_access_changed(unit);
return; return;
} }
ZFCP_LOG_NORMAL("Trying to reopen port 0x%016Lx on adapter %s " ZFCP_LOG_NORMAL("reopen of port 0x%016Lx on adapter %s "
"due to update to access control table\n", "(due to ACT update)\n",
port->wwpn, zfcp_get_busid_by_adapter(adapter)); port->wwpn, zfcp_get_busid_by_adapter(adapter));
if (zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED) != 0) if (zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED) != 0)
ZFCP_LOG_NORMAL("Reopen of port 0x%016Lx on adapter %s failed\n", ZFCP_LOG_NORMAL("failed reopen of port"
port->wwpn, zfcp_get_busid_by_adapter(adapter)); "(adapter %s, wwpn=0x%016Lx)\n",
zfcp_get_busid_by_adapter(adapter), port->wwpn);
} }
/* /*
...@@ -3572,16 +3571,15 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit) ...@@ -3572,16 +3571,15 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit)
if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status)) if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status))
return; return;
ZFCP_LOG_NORMAL("Trying to reopen unit 0x%016Lx " ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx "
"on port 0x%016Lx on adapter %s " " on adapter %s (due to ACT update)\n",
"due to update to access control table\n",
unit->fcp_lun, unit->port->wwpn, unit->fcp_lun, unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
if (zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED) != 0) if (zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED) != 0)
ZFCP_LOG_NORMAL("Reopen of unit 0x%016Lx " ZFCP_LOG_NORMAL("failed reopen of unit (adapter %s, "
"on port 0x%016Lx on adapter %s failed\n", "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n",
unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_adapter(adapter),
zfcp_get_busid_by_adapter(adapter)); unit->port->wwpn, unit->fcp_lun);
} }
#undef ZFCP_LOG_AREA #undef ZFCP_LOG_AREA
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#ifndef ZFCP_EXT_H #ifndef ZFCP_EXT_H
#define ZFCP_EXT_H #define ZFCP_EXT_H
/* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_EXT_REVISION "$Revision: 1.61 $" #define ZFCP_EXT_REVISION "$Revision: 1.62 $"
#include "zfcp_def.h" #include "zfcp_def.h"
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* this drivers version (do not edit !!! generated and updated by cvs) */ #define ZFCP_FSF_C_REVISION "$Revision: 1.88 $"
#define ZFCP_FSF_C_REVISION "$Revision: 1.86 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -1737,7 +1736,7 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1737,7 +1736,7 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
adapter = els->adapter; adapter = els->adapter;
ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, ret = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS,
ZFCP_WAIT_FOR_SBAL|ZFCP_REQ_AUTO_CLEANUP, ZFCP_REQ_AUTO_CLEANUP,
NULL, &lock_flags, &fsf_req); NULL, &lock_flags, &fsf_req);
if (ret < 0) { if (ret < 0) {
ZFCP_LOG_INFO("error: creation of ELS request failed " ZFCP_LOG_INFO("error: creation of ELS request failed "
...@@ -3094,57 +3093,11 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3094,57 +3093,11 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
exclusive = bottom->lun_access_info & FSF_UNIT_ACCESS_EXCLUSIVE; exclusive = bottom->lun_access_info & FSF_UNIT_ACCESS_EXCLUSIVE;
readwrite = bottom->lun_access_info & FSF_UNIT_ACCESS_OUTBOUND_TRANSFER; readwrite = bottom->lun_access_info & FSF_UNIT_ACCESS_OUTBOUND_TRANSFER;
if (!adapter->supported_features & FSF_FEATURE_CFDC)
goto no_cfdc;
atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
ZFCP_STATUS_UNIT_SHARED | ZFCP_STATUS_UNIT_SHARED |
ZFCP_STATUS_UNIT_READONLY, ZFCP_STATUS_UNIT_READONLY,
&unit->status); &unit->status);
if (!allowed)
atomic_set_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status);
if (!adapter->supported_features & FSF_FEATURE_LUN_SHARING)
goto no_lun_sharing;
if (!exclusive)
atomic_set_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status);
if (!readwrite) {
atomic_set_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status);
ZFCP_LOG_NORMAL("Unit 0x%016Lx on port 0x%016Lx on adapter %s "
"accessed read-only\n", unit->fcp_lun,
unit->port->wwpn, zfcp_get_busid_by_unit(unit));
}
if (exclusive && !readwrite) {
ZFCP_LOG_NORMAL("Exclusive access of read-only unit not "
"supported\n");
zfcp_erp_unit_failed(unit);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
goto skip_fsfstatus;
}
if (!exclusive && readwrite) {
ZFCP_LOG_NORMAL("Shared access of read-write unit is not "
"supported\n");
zfcp_erp_unit_failed(unit);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
goto skip_fsfstatus;
}
no_lun_sharing:
no_cfdc:
if (!(adapter->supported_features & FSF_FEATURE_CFDC) &&
(adapter->supported_features & FSF_FEATURE_LUN_SHARING)) {
ZFCP_LOG_NORMAL("LUN sharing without access control is not "
"supported.\n");
zfcp_erp_unit_failed(unit);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
goto skip_fsfstatus;
}
/* evaluate FSF status in QTCB */ /* evaluate FSF status in QTCB */
switch (header->fsf_status) { switch (header->fsf_status) {
...@@ -3196,6 +3149,8 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ...@@ -3196,6 +3149,8 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
} }
debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); debug_text_event(adapter->erp_dbf, 1, "fsf_s_access");
zfcp_erp_unit_access_denied(unit); zfcp_erp_unit_access_denied(unit);
atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status);
atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status);
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break; break;
......
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI #define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
/* this drivers version (do not edit !!! generated and updated by cvs) */ #define ZFCP_SCSI_REVISION "$Revision: 1.74 $"
#define ZFCP_SCSI_REVISION "$Revision: 1.73 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
......
...@@ -1767,7 +1767,7 @@ config SCSI_SUNESP ...@@ -1767,7 +1767,7 @@ config SCSI_SUNESP
config ZFCP config ZFCP
tristate "FCP host bus adapter driver for IBM eServer zSeries" tristate "FCP host bus adapter driver for IBM eServer zSeries"
depends on ARCH_S390 && SCSI depends on ARCH_S390 && QDIO && SCSI
select SCSI_FC_ATTRS select SCSI_FC_ATTRS
help help
If you want to access SCSI devices attached to your IBM eServer If you want to access SCSI devices attached to your IBM eServer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment