public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/3] zfcp fixes for 2.6.33-rc4
@ 2010-01-13 16:52 Christof Schmitt
  2010-01-13 16:52 ` [patch 1/3] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request Christof Schmitt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christof Schmitt @ 2010-01-13 16:52 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens

James,

here are 3 zfcp fixes for the 2.6.33-rc series. The patches apply on
top of 2.6.33-rc4.

We are also working on fixes for the FC BSG timeout handling in zfcp.
I will send them tomorrow in an additional patch series to have the
proposed change in the FC transport class and the related zfcp patches
in one place.

--
Christof Schmitt


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 1/3] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request
  2010-01-13 16:52 [patch 0/3] zfcp fixes for 2.6.33-rc4 Christof Schmitt
@ 2010-01-13 16:52 ` Christof Schmitt
  2010-01-13 16:52 ` [patch 2/3] zfcp: Fix linebreak in hba trace Christof Schmitt
  2010-01-13 16:52 ` [patch 3/3] zfcp: add missing compat ptr conversion Christof Schmitt
  2 siblings, 0 replies; 4+ messages in thread
From: Christof Schmitt @ 2010-01-13 16:52 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens,
	Christof Schmitt

[-- Attachment #1: 702-zfcp-wka-port-put.diff --]
[-- Type: text/plain, Size: 3377 bytes --]

From: Christof Schmitt <christof.schmitt@de.ibm.com>

The patch "zfcp: Simplify handling of ct and els requests"
accidentally removed the call to zfcp_fc_wka_port_put for FC CT BSG
requests, thus not issuing a "close" request for the WKA ports.
Introduce a CT specific handler to first call zfcp_fc_wka_port_put and
then continue with the generic handler when returning from FC CT BSG
requests.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---

 drivers/s390/scsi/zfcp_fc.c |   65 +++++++++++++++++++++++++++++---------------
 1 file changed, 43 insertions(+), 22 deletions(-)

diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fc.c linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c
--- linux-2.6/drivers/s390/scsi/zfcp_fc.c	2010-01-12 11:18:38.000000000 +0100
+++ linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c	2010-01-12 11:18:59.000000000 +0100
@@ -677,6 +677,44 @@ static void zfcp_fc_ct_els_job_handler(v
 	job->job_done(job);
 }
 
+static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)
+{
+	u32 preamble_word1;
+	u8 gs_type;
+	struct zfcp_adapter *adapter;
+
+	preamble_word1 = job->request->rqst_data.r_ct.preamble_word1;
+	gs_type = (preamble_word1 & 0xff000000) >> 24;
+
+	adapter = (struct zfcp_adapter *) job->shost->hostdata[0];
+
+	switch (gs_type) {
+	case FC_FST_ALIAS:
+		return &adapter->gs->as;
+	case FC_FST_MGMT:
+		return &adapter->gs->ms;
+	case FC_FST_TIME:
+		return &adapter->gs->ts;
+		break;
+	case FC_FST_DIR:
+		return &adapter->gs->ds;
+		break;
+	default:
+		return NULL;
+	}
+}
+
+static void zfcp_fc_ct_job_handler(void *data)
+{
+	struct fc_bsg_job *job = data;
+	struct zfcp_fc_wka_port *wka_port;
+
+	wka_port = zfcp_fc_job_wka_port(job);
+	zfcp_fc_wka_port_put(wka_port);
+
+	zfcp_fc_ct_els_job_handler(data);
+}
+
 static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
 				struct zfcp_adapter *adapter)
 {
@@ -695,6 +733,7 @@ static int zfcp_fc_exec_els_job(struct f
 	} else
 		d_id = ntoh24(job->request->rqst_data.h_els.port_id);
 
+	els->handler = zfcp_fc_ct_els_job_handler;
 	return zfcp_fsf_send_els(adapter, d_id, els);
 }
 
@@ -702,35 +741,18 @@ static int zfcp_fc_exec_ct_job(struct fc
 			       struct zfcp_adapter *adapter)
 {
 	int ret;
-	u8 gs_type;
 	struct zfcp_fsf_ct_els *ct = job->dd_data;
 	struct zfcp_fc_wka_port *wka_port;
-	u32 preamble_word1;
 
-	preamble_word1 = job->request->rqst_data.r_ct.preamble_word1;
-	gs_type = (preamble_word1 & 0xff000000) >> 24;
-
-	switch (gs_type) {
-	case FC_FST_ALIAS:
-		wka_port = &adapter->gs->as;
-		break;
-	case FC_FST_MGMT:
-		wka_port = &adapter->gs->ms;
-		break;
-	case FC_FST_TIME:
-		wka_port = &adapter->gs->ts;
-		break;
-	case FC_FST_DIR:
-		wka_port = &adapter->gs->ds;
-		break;
-	default:
-		return -EINVAL; /* no such service */
-	}
+	wka_port = zfcp_fc_job_wka_port(job);
+	if (!wka_port)
+		return -EINVAL;
 
 	ret = zfcp_fc_wka_port_get(wka_port);
 	if (ret)
 		return ret;
 
+	ct->handler = zfcp_fc_ct_job_handler;
 	ret = zfcp_fsf_send_ct(wka_port, ct, NULL);
 	if (ret)
 		zfcp_fc_wka_port_put(wka_port);
@@ -752,7 +774,6 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_j
 
 	ct_els->req = job->request_payload.sg_list;
 	ct_els->resp = job->reply_payload.sg_list;
-	ct_els->handler = zfcp_fc_ct_els_job_handler;
 	ct_els->handler_data = job;
 
 	switch (job->request->msgcode) {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 2/3] zfcp: Fix linebreak in hba trace
  2010-01-13 16:52 [patch 0/3] zfcp fixes for 2.6.33-rc4 Christof Schmitt
  2010-01-13 16:52 ` [patch 1/3] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request Christof Schmitt
@ 2010-01-13 16:52 ` Christof Schmitt
  2010-01-13 16:52 ` [patch 3/3] zfcp: add missing compat ptr conversion Christof Schmitt
  2 siblings, 0 replies; 4+ messages in thread
From: Christof Schmitt @ 2010-01-13 16:52 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens,
	Christof Schmitt

[-- Attachment #1: 703-zfcp-trace-linebreak.diff --]
[-- Type: text/plain, Size: 1033 bytes --]

From: Christof Schmitt <christof.schmitt@de.ibm.com>

Advance the correct pointer when inserting the linebreak for the HBA
trace. It was missing in the output since the pointer to the output
buffer was never advanced, and the linebreak character was overwritten
later.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---

 drivers/s390/scsi/zfcp_dbf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -urpN linux-2.6/drivers/s390/scsi/zfcp_dbf.c linux-2.6-patched/drivers/s390/scsi/zfcp_dbf.c
--- linux-2.6/drivers/s390/scsi/zfcp_dbf.c	2010-01-12 11:18:59.000000000 +0100
+++ linux-2.6-patched/drivers/s390/scsi/zfcp_dbf.c	2010-01-12 11:19:00.000000000 +0100
@@ -327,7 +327,7 @@ static void zfcp_dbf_hba_view_response(c
 			break;
 		zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd);
 		zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial);
-		p += sprintf(*p, "\n");
+		*p += sprintf(*p, "\n");
 		break;
 
 	case FSF_QTCB_OPEN_PORT_WITH_DID:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 3/3] zfcp: add missing compat ptr conversion
  2010-01-13 16:52 [patch 0/3] zfcp fixes for 2.6.33-rc4 Christof Schmitt
  2010-01-13 16:52 ` [patch 1/3] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request Christof Schmitt
  2010-01-13 16:52 ` [patch 2/3] zfcp: Fix linebreak in hba trace Christof Schmitt
@ 2010-01-13 16:52 ` Christof Schmitt
  2 siblings, 0 replies; 4+ messages in thread
From: Christof Schmitt @ 2010-01-13 16:52 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens,
	Christof Schmitt

[-- Attachment #1: 705-zfcp-compat-ptr.diff --]
[-- Type: text/plain, Size: 1151 bytes --]

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---

 drivers/s390/scsi/zfcp_cfdc.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/drivers/s390/scsi/zfcp_cfdc.c	2010-01-13 17:41:07.000000000 +0100
+++ b/drivers/s390/scsi/zfcp_cfdc.c	2010-01-13 17:45:39.000000000 +0100
@@ -12,6 +12,7 @@
 
 #include <linux/types.h>
 #include <linux/miscdevice.h>
+#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include "zfcp_def.h"
 #include "zfcp_ext.h"
@@ -163,7 +164,7 @@ static void zfcp_cfdc_req_to_sense(struc
 }
 
 static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
-				unsigned long buffer)
+				unsigned long arg)
 {
 	struct zfcp_cfdc_data *data;
 	struct zfcp_cfdc_data __user *data_user;
@@ -175,7 +176,11 @@ static long zfcp_cfdc_dev_ioctl(struct f
 	if (command != ZFCP_CFDC_IOC)
 		return -ENOTTY;
 
-	data_user = (void __user *) buffer;
+	if (is_compat_task())
+		data_user = compat_ptr(arg);
+	else
+		data_user = (void __user *)arg;
+
 	if (!data_user)
 		return -EINVAL;
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-13 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 16:52 [patch 0/3] zfcp fixes for 2.6.33-rc4 Christof Schmitt
2010-01-13 16:52 ` [patch 1/3] zfcp: Issue zfcp_fc_wka_port_put after FC CT BSG request Christof Schmitt
2010-01-13 16:52 ` [patch 2/3] zfcp: Fix linebreak in hba trace Christof Schmitt
2010-01-13 16:52 ` [patch 3/3] zfcp: add missing compat ptr conversion Christof Schmitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox