From: Hendrik Brueckner <brueckner@redhat.com> Date: Wed, 4 Aug 2010 10:02:56 -0400 Subject: [s390] zfcp: no force close when port is already closed Message-id: <1280916181-27024-4-git-send-email-brueckner@redhat.com> Patchwork-id: 27372 O-Subject: [RHEL5.6 PATCH 3/8] [s390x] zfcp: Do not try "forced close" when port is already closed Bugzilla: 612263 RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com> Description ----------- After a remote port failure, the erp action fails. The requested "reopen port forced" erp action tries to issue a "physical port closed", although the port is not open, thus failing the erp action. When a "reopen port forced" is requested for a closed port, try a "port reopen" instead. Bugzilla -------- BZ 612263 https://bugzilla.redhat.com/show_bug.cgi?id=612263 Upstream status of the patch ---------------------------- http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commit;h=097ef3bd0cd4f156fee039e52855d095b7ba3db4 Test status ----------- The patch has been tested and fixes the problem. The fix has been verified by the IBM test department. diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index f735466..30397b7 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -2767,6 +2767,9 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, /* fall through !!! */ case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: + if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) + need = ZFCP_ERP_ACTION_REOPEN_PORT; + if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)) { if (port->erp_action.action !=