All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] iscsi: iscsi changes for 3.17
@ 2014-07-12 20:51 michaelc
  2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: michaelc @ 2014-07-12 20:51 UTC (permalink / raw)
  To: linux-scsi

The following patches were made over Chrisoph's scsi-queue drivers-for-3.17
branch. They are some fixes to the get_host_stats code and new error code
for when a iscsi ping times out.

Note for applying/merging:

The patches also apply over James's scsi misc branch, but that branch
is missing some patches that Chrisoph has picked up.


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

* [PATCH 1/4] iscsi class: fix get_host_stats error handling
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
@ 2014-07-12 20:51 ` michaelc
  2014-07-30 12:50   ` Hannes Reinecke
  2014-07-12 20:51 ` [PATCH 2/4] qla4xxx: fix get_host_stats error propagation michaelc
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: michaelc @ 2014-07-12 20:51 UTC (permalink / raw)
  To: linux-scsi

From: Mike Christie <michaelc@cs.wisc.edu>

iscsi_get_host_stats was dropping the error code returned
by drivers like qla4xxx.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/scsi_transport_iscsi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index b481e62..14bfa53 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
 		memset(buf, 0, host_stats_size);
 
 		err = transport->get_host_stats(shost, buf, host_stats_size);
+		if (err) {
+			kfree(skbhost_stats);
+			goto exit_host_stats;
+		}
 
 		actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
 		skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
-- 
1.7.1


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

* [PATCH 2/4] qla4xxx: fix get_host_stats error propagation
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
  2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
@ 2014-07-12 20:51 ` michaelc
  2014-07-30 12:51   ` Hannes Reinecke
  2014-07-12 20:51 ` [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported michaelc
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: michaelc @ 2014-07-12 20:51 UTC (permalink / raw)
  To: linux-scsi

From: Mike Christie <michaelc@cs.wisc.edu>

qla4xxx was not always returning -EXYZ error codes when
qla4xxx_get_host_stats failed.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>

---
 drivers/scsi/qla4xxx/ql4_os.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index c5d9564..b79b48c 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1050,6 +1050,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len)
 	if (!ql_iscsi_stats) {
 		ql4_printk(KERN_ERR, ha,
 			   "Unable to allocate memory for iscsi stats\n");
+		ret = -ENOMEM;
 		goto exit_host_stats;
 	}
 
@@ -1058,6 +1059,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len)
 	if (ret != QLA_SUCCESS) {
 		ql4_printk(KERN_ERR, ha,
 			   "Unable to retrieve iscsi stats\n");
+		ret = -EIO;
 		goto exit_host_stats;
 	}
 	host_stats->mactx_frames = le64_to_cpu(ql_iscsi_stats->mac_tx_frames);
-- 
1.7.1


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

* [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
  2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
  2014-07-12 20:51 ` [PATCH 2/4] qla4xxx: fix get_host_stats error propagation michaelc
@ 2014-07-12 20:51 ` michaelc
  2014-07-30 12:52   ` Hannes Reinecke
  2014-07-12 20:51 ` [PATCH 4/4] libiscsi: return new error code when nop times out michaelc
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: michaelc @ 2014-07-12 20:51 UTC (permalink / raw)
  To: linux-scsi

From: Mike Christie <michaelc@cs.wisc.edu>

When the get_host_stats call was not supported we were
returing EINVAL. This has us return ENOSYS, because for
software iscsi drivers where there is no host it is ok to not
have this callout.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/scsi_transport_iscsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 14bfa53..534d3fb 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -3429,7 +3429,7 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
 	char *buf;
 
 	if (!transport->get_host_stats)
-		return -EINVAL;
+		return -ENOSYS;
 
 	priv = iscsi_if_transport_lookup(transport);
 	if (!priv)
-- 
1.7.1


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

* [PATCH 4/4] libiscsi: return new error code when nop times out
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
                   ` (2 preceding siblings ...)
  2014-07-12 20:51 ` [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported michaelc
@ 2014-07-12 20:51 ` michaelc
  2014-07-30 12:52   ` Hannes Reinecke
  2014-07-13  9:50 ` [PATCH 0/4] iscsi: iscsi changes for 3.17 Christoph Hellwig
  2014-07-30 11:43 ` Christoph Hellwig
  5 siblings, 1 reply; 15+ messages in thread
From: michaelc @ 2014-07-12 20:51 UTC (permalink / raw)
  To: linux-scsi

From: Mike Christie <michaelc@cs.wisc.edu>

When a iscsi nop as ping timedout we were failing with the
common connection error code, ISCSI_ERR_CONN_FAILED. This
patch adds a new error code for this problem so can properly
track/distinguish in userspace.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/libiscsi.c |    2 +-
 include/scsi/iscsi_if.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index f2db82b..b0813fd 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2097,7 +2097,7 @@ static void iscsi_check_transport_timeouts(unsigned long data)
 				  conn->ping_timeout, conn->recv_timeout,
 				  last_recv, conn->last_ping, jiffies);
 		spin_unlock(&session->frwd_lock);
-		iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
+		iscsi_conn_failure(conn, ISCSI_ERR_NOP_TIMEDOUT);
 		return;
 	}
 
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index fd0421c..95ed942 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -527,6 +527,7 @@ enum iscsi_err {
 	ISCSI_ERR_XMIT_FAILED		= ISCSI_ERR_BASE + 19,
 	ISCSI_ERR_TCP_CONN_CLOSE	= ISCSI_ERR_BASE + 20,
 	ISCSI_ERR_SCSI_EH_SESSION_RST	= ISCSI_ERR_BASE + 21,
+	ISCSI_ERR_NOP_TIMEDOUT		= ISCSI_ERR_BASE + 22,
 };
 
 /*
-- 
1.7.1


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

* Re: [PATCH 0/4] iscsi: iscsi changes for 3.17
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
                   ` (3 preceding siblings ...)
  2014-07-12 20:51 ` [PATCH 4/4] libiscsi: return new error code when nop times out michaelc
@ 2014-07-13  9:50 ` Christoph Hellwig
  2014-07-30 12:51   ` Vikas Chaudhary
  2014-07-30 11:43 ` Christoph Hellwig
  5 siblings, 1 reply; 15+ messages in thread
From: Christoph Hellwig @ 2014-07-13  9:50 UTC (permalink / raw)
  To: michaelc; +Cc: linux-scsi

On Sat, Jul 12, 2014 at 03:51:47PM -0500, michaelc@cs.wisc.edu wrote:
> The following patches were made over Chrisoph's scsi-queue drivers-for-3.17
> branch. They are some fixes to the get_host_stats code and new error code
> for when a iscsi ping times out.

The series looks fine to me, I'll merge it as soon as I get the
remaining second reviews.


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

* Re: [PATCH 0/4] iscsi: iscsi changes for 3.17
  2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
                   ` (4 preceding siblings ...)
  2014-07-13  9:50 ` [PATCH 0/4] iscsi: iscsi changes for 3.17 Christoph Hellwig
@ 2014-07-30 11:43 ` Christoph Hellwig
  5 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2014-07-30 11:43 UTC (permalink / raw)
  To: michaelc, Tomas Henzl, Hannes Reinecke, Vikas Chaudhary; +Cc: linux-scsi

Can I get reviews for the remaining patches, please?

On Sat, Jul 12, 2014 at 03:51:47PM -0500, michaelc@cs.wisc.edu wrote:
> The following patches were made over Chrisoph's scsi-queue drivers-for-3.17
> branch. They are some fixes to the get_host_stats code and new error code
> for when a iscsi ping times out.
> 
> Note for applying/merging:
> 
> The patches also apply over James's scsi misc branch, but that branch
> is missing some patches that Chrisoph has picked up.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---

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

* Re: [PATCH 1/4] iscsi class: fix get_host_stats error handling
  2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
@ 2014-07-30 12:50   ` Hannes Reinecke
  2014-07-31 22:32     ` Mike Christie
  0 siblings, 1 reply; 15+ messages in thread
From: Hannes Reinecke @ 2014-07-30 12:50 UTC (permalink / raw)
  To: michaelc, linux-scsi

On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> iscsi_get_host_stats was dropping the error code returned
> by drivers like qla4xxx.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
>   drivers/scsi/scsi_transport_iscsi.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index b481e62..14bfa53 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
>   		memset(buf, 0, host_stats_size);
>
>   		err = transport->get_host_stats(shost, buf, host_stats_size);
> +		if (err) {
> +			kfree(skbhost_stats);
> +			goto exit_host_stats;
> +		}
>
>   		actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
>   		skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
>
What happens with the skbhost_stats allocated earlier? Shouldn't it 
be freed here, too?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/4] qla4xxx: fix get_host_stats error propagation
  2014-07-12 20:51 ` [PATCH 2/4] qla4xxx: fix get_host_stats error propagation michaelc
@ 2014-07-30 12:51   ` Hannes Reinecke
  0 siblings, 0 replies; 15+ messages in thread
From: Hannes Reinecke @ 2014-07-30 12:51 UTC (permalink / raw)
  To: michaelc, linux-scsi

On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> qla4xxx was not always returning -EXYZ error codes when
> qla4xxx_get_host_stats failed.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>
> ---
>   drivers/scsi/qla4xxx/ql4_os.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index c5d9564..b79b48c 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -1050,6 +1050,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len)
>   	if (!ql_iscsi_stats) {
>   		ql4_printk(KERN_ERR, ha,
>   			   "Unable to allocate memory for iscsi stats\n");
> +		ret = -ENOMEM;
>   		goto exit_host_stats;
>   	}
>
> @@ -1058,6 +1059,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len)
>   	if (ret != QLA_SUCCESS) {
>   		ql4_printk(KERN_ERR, ha,
>   			   "Unable to retrieve iscsi stats\n");
> +		ret = -EIO;
>   		goto exit_host_stats;
>   	}
>   	host_stats->mactx_frames = le64_to_cpu(ql_iscsi_stats->mac_tx_frames);
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/4] iscsi: iscsi changes for 3.17
  2014-07-13  9:50 ` [PATCH 0/4] iscsi: iscsi changes for 3.17 Christoph Hellwig
@ 2014-07-30 12:51   ` Vikas Chaudhary
  0 siblings, 0 replies; 15+ messages in thread
From: Vikas Chaudhary @ 2014-07-30 12:51 UTC (permalink / raw)
  To: Christoph Hellwig, michaelc; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]



On 13/07/14 3:20 pm, "Christoph Hellwig" <hch@infradead.org> wrote:

>On Sat, Jul 12, 2014 at 03:51:47PM -0500, michaelc@cs.wisc.edu wrote:
>> The following patches were made over Chrisoph's scsi-queue
>>drivers-for-3.17
>> branch. They are some fixes to the get_host_stats code and new error
>>code
>> for when a iscsi ping times out.
>
>The series looks fine to me, I'll merge it as soon as I get the
>remaining second reviews.

Ack for series

Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4154 bytes --]

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

* Re: [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported
  2014-07-12 20:51 ` [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported michaelc
@ 2014-07-30 12:52   ` Hannes Reinecke
  0 siblings, 0 replies; 15+ messages in thread
From: Hannes Reinecke @ 2014-07-30 12:52 UTC (permalink / raw)
  To: michaelc, linux-scsi

On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> When the get_host_stats call was not supported we were
> returing EINVAL. This has us return ENOSYS, because for
> software iscsi drivers where there is no host it is ok to not
> have this callout.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
>   drivers/scsi/scsi_transport_iscsi.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 14bfa53..534d3fb 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -3429,7 +3429,7 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
>   	char *buf;
>
>   	if (!transport->get_host_stats)
> -		return -EINVAL;
> +		return -ENOSYS;
>
>   	priv = iscsi_if_transport_lookup(transport);
>   	if (!priv)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 4/4] libiscsi: return new error code when nop times out
  2014-07-12 20:51 ` [PATCH 4/4] libiscsi: return new error code when nop times out michaelc
@ 2014-07-30 12:52   ` Hannes Reinecke
  0 siblings, 0 replies; 15+ messages in thread
From: Hannes Reinecke @ 2014-07-30 12:52 UTC (permalink / raw)
  To: michaelc, linux-scsi

On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
>
> When a iscsi nop as ping timedout we were failing with the
> common connection error code, ISCSI_ERR_CONN_FAILED. This
> patch adds a new error code for this problem so can properly
> track/distinguish in userspace.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
>   drivers/scsi/libiscsi.c |    2 +-
>   include/scsi/iscsi_if.h |    1 +
>   2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index f2db82b..b0813fd 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -2097,7 +2097,7 @@ static void iscsi_check_transport_timeouts(unsigned long data)
>   				  conn->ping_timeout, conn->recv_timeout,
>   				  last_recv, conn->last_ping, jiffies);
>   		spin_unlock(&session->frwd_lock);
> -		iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
> +		iscsi_conn_failure(conn, ISCSI_ERR_NOP_TIMEDOUT);
>   		return;
>   	}
>
> diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
> index fd0421c..95ed942 100644
> --- a/include/scsi/iscsi_if.h
> +++ b/include/scsi/iscsi_if.h
> @@ -527,6 +527,7 @@ enum iscsi_err {
>   	ISCSI_ERR_XMIT_FAILED		= ISCSI_ERR_BASE + 19,
>   	ISCSI_ERR_TCP_CONN_CLOSE	= ISCSI_ERR_BASE + 20,
>   	ISCSI_ERR_SCSI_EH_SESSION_RST	= ISCSI_ERR_BASE + 21,
> +	ISCSI_ERR_NOP_TIMEDOUT		= ISCSI_ERR_BASE + 22,
>   };
>
>   /*
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/4] iscsi class: fix get_host_stats error handling
  2014-07-30 12:50   ` Hannes Reinecke
@ 2014-07-31 22:32     ` Mike Christie
  2014-08-01 13:31       ` Hannes Reinecke
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Christie @ 2014-07-31 22:32 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: linux-scsi

On 07/30/2014 07:50 AM, Hannes Reinecke wrote:
> On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
>> From: Mike Christie <michaelc@cs.wisc.edu>
>>
>> iscsi_get_host_stats was dropping the error code returned
>> by drivers like qla4xxx.
>>
>> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>> ---
>>   drivers/scsi/scsi_transport_iscsi.c |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_transport_iscsi.c
>> b/drivers/scsi/scsi_transport_iscsi.c
>> index b481e62..14bfa53 100644
>> --- a/drivers/scsi/scsi_transport_iscsi.c
>> +++ b/drivers/scsi/scsi_transport_iscsi.c
>> @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport
>> *transport, struct nlmsghdr *nlh)
>>           memset(buf, 0, host_stats_size);
>>
>>           err = transport->get_host_stats(shost, buf, host_stats_size);
>> +        if (err) {
>> +            kfree(skbhost_stats);
>> +            goto exit_host_stats;
>> +        }
>>
>>           actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
>>           skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
>>
> What happens with the skbhost_stats allocated earlier? Shouldn't it be
> freed here, too?
> 

You mean for this success path right. It is not freed here by the iscsi
code on purpose. For the code path here where we have successfully
called into the driver then a couple lines below we will do

iscsi_multicast_skb() -> nlmsg_multicast()

which will pass the skbhost_stats skb to the netlink layer. The
netlink/socket/skb code then frees it when it is done with it.


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

* Re: [PATCH 1/4] iscsi class: fix get_host_stats error handling
  2014-07-31 22:32     ` Mike Christie
@ 2014-08-01 13:31       ` Hannes Reinecke
  2014-08-01 16:10         ` Mike Christie
  0 siblings, 1 reply; 15+ messages in thread
From: Hannes Reinecke @ 2014-08-01 13:31 UTC (permalink / raw)
  To: Mike Christie; +Cc: linux-scsi

On 08/01/2014 12:32 AM, Mike Christie wrote:
> On 07/30/2014 07:50 AM, Hannes Reinecke wrote:
>> On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
>>> From: Mike Christie <michaelc@cs.wisc.edu>
>>>
>>> iscsi_get_host_stats was dropping the error code returned
>>> by drivers like qla4xxx.
>>>
>>> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>>> ---
>>>    drivers/scsi/scsi_transport_iscsi.c |    4 ++++
>>>    1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/scsi/scsi_transport_iscsi.c
>>> b/drivers/scsi/scsi_transport_iscsi.c
>>> index b481e62..14bfa53 100644
>>> --- a/drivers/scsi/scsi_transport_iscsi.c
>>> +++ b/drivers/scsi/scsi_transport_iscsi.c
>>> @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport
>>> *transport, struct nlmsghdr *nlh)
>>>            memset(buf, 0, host_stats_size);
>>>
>>>            err = transport->get_host_stats(shost, buf, host_stats_size);
>>> +        if (err) {
>>> +            kfree(skbhost_stats);
>>> +            goto exit_host_stats;
>>> +        }
>>>
>>>            actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
>>>            skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
>>>
>> What happens with the skbhost_stats allocated earlier? Shouldn't it be
>> freed here, too?
>>
>
> You mean for this success path right. It is not freed here by the iscsi
> code on purpose. For the code path here where we have successfully
> called into the driver then a couple lines below we will do
>
> iscsi_multicast_skb() -> nlmsg_multicast()
>
> which will pass the skbhost_stats skb to the netlink layer. The
> netlink/socket/skb code then frees it when it is done with it.
>
No, I meant the failure path.

You do an alloc_skb above, then get_host_stats failed, and you exit 
the function without freeing the skb.
Or do I miss something?


Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/4] iscsi class: fix get_host_stats error handling
  2014-08-01 13:31       ` Hannes Reinecke
@ 2014-08-01 16:10         ` Mike Christie
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Christie @ 2014-08-01 16:10 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: linux-scsi

On 08/01/2014 08:31 AM, Hannes Reinecke wrote:
> On 08/01/2014 12:32 AM, Mike Christie wrote:
>> On 07/30/2014 07:50 AM, Hannes Reinecke wrote:
>>> On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
>>>> From: Mike Christie <michaelc@cs.wisc.edu>
>>>>
>>>> iscsi_get_host_stats was dropping the error code returned
>>>> by drivers like qla4xxx.
>>>>
>>>> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>>>> ---
>>>>    drivers/scsi/scsi_transport_iscsi.c |    4 ++++
>>>>    1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/scsi/scsi_transport_iscsi.c
>>>> b/drivers/scsi/scsi_transport_iscsi.c
>>>> index b481e62..14bfa53 100644
>>>> --- a/drivers/scsi/scsi_transport_iscsi.c
>>>> +++ b/drivers/scsi/scsi_transport_iscsi.c
>>>> @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport
>>>> *transport, struct nlmsghdr *nlh)
>>>>            memset(buf, 0, host_stats_size);
>>>>
>>>>            err = transport->get_host_stats(shost, buf,
>>>> host_stats_size);
>>>> +        if (err) {
>>>> +            kfree(skbhost_stats);
>>>> +            goto exit_host_stats;
>>>> +        }
>>>>
>>>>            actual_size = nlmsg_total_size(sizeof(*ev) +
>>>> host_stats_size);
>>>>            skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
>>>>
>>> What happens with the skbhost_stats allocated earlier? Shouldn't it be
>>> freed here, too?
>>>
>>
>> You mean for this success path right. It is not freed here by the iscsi
>> code on purpose. For the code path here where we have successfully
>> called into the driver then a couple lines below we will do
>>
>> iscsi_multicast_skb() -> nlmsg_multicast()
>>
>> which will pass the skbhost_stats skb to the netlink layer. The
>> netlink/socket/skb code then frees it when it is done with it.
>>
> No, I meant the failure path.
> 
> You do an alloc_skb above, then get_host_stats failed, and you exit the
> function without freeing the skb.

Ah, actually I am freeing it, but I now realize with the wrong function,
so I think that is why I was confused by your comment.  Above I added a
kfree() of the skb. I should be using kfree_skb. Will fix it up. Thanks.

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

end of thread, other threads:[~2014-08-01 16:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
2014-07-30 12:50   ` Hannes Reinecke
2014-07-31 22:32     ` Mike Christie
2014-08-01 13:31       ` Hannes Reinecke
2014-08-01 16:10         ` Mike Christie
2014-07-12 20:51 ` [PATCH 2/4] qla4xxx: fix get_host_stats error propagation michaelc
2014-07-30 12:51   ` Hannes Reinecke
2014-07-12 20:51 ` [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported michaelc
2014-07-30 12:52   ` Hannes Reinecke
2014-07-12 20:51 ` [PATCH 4/4] libiscsi: return new error code when nop times out michaelc
2014-07-30 12:52   ` Hannes Reinecke
2014-07-13  9:50 ` [PATCH 0/4] iscsi: iscsi changes for 3.17 Christoph Hellwig
2014-07-30 12:51   ` Vikas Chaudhary
2014-07-30 11:43 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.