linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: iscsi: special case for GET_HOST_STATS
@ 2024-11-03  7:02 Xiang Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Xiang Zhang @ 2024-11-03  7:02 UTC (permalink / raw)
  To: lduncan, cleech, michael.christie, James.Bottomley,
	martin.petersen
  Cc: open-iscsi, linux-scsi, linux-kernel, Xiang Zhang

Special case for ISCSI_UEVENT_GET_HOST_STATS:
- On success: send reply and stats from iscsi_get_host_stats()
  within if_recv_msg().
- On error: fall through.

Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
---
 drivers/scsi/scsi_transport_iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index fde7de3b1e55..ad4186da1cb4 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
 				break;
 			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
 				break;
+			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
+				break;
 			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
 						  ev, sizeof(*ev));
 			if (err == -EAGAIN && --retries < 0) {
-- 
2.44.0


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

* [PATCH] scsi: iscsi: special case for GET_HOST_STATS
@ 2024-11-11  6:21 Xiang Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Xiang Zhang @ 2024-11-11  6:21 UTC (permalink / raw)
  To: lduncan, cleech, michael.christie, James.Bottomley,
	martin.petersen
  Cc: linux-scsi, linux-kernel, Xiang Zhang

Special case for ISCSI_UEVENT_GET_HOST_STATS:
- On success: send reply and stats from iscsi_get_host_stats()
  within if_recv_msg().
- On error: fall through.

Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
---
 drivers/scsi/scsi_transport_iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index fde7de3b1e55..ad4186da1cb4 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
 				break;
 			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
 				break;
+			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
+				break;
 			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
 						  ev, sizeof(*ev));
 			if (err == -EAGAIN && --retries < 0) {
-- 
2.44.0


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

* [PATCH] scsi: iscsi: special case for GET_HOST_STATS
@ 2025-01-03 11:11 Xiang Zhang
  2025-01-03 18:46 ` michael.christie
  0 siblings, 1 reply; 9+ messages in thread
From: Xiang Zhang @ 2025-01-03 11:11 UTC (permalink / raw)
  To: lduncan, cleech, michael.christie, James.Bottomley,
	martin.petersen
  Cc: linux-scsi, linux-kernel, Xiang Zhang

Special case for ISCSI_UEVENT_GET_HOST_STATS:
- On success: send reply and stats from iscsi_get_host_stats()
  within if_recv_msg().
- On error: fall through.

Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
---
 drivers/scsi/scsi_transport_iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index fde7de3b1e55..ad4186da1cb4 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
 				break;
 			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
 				break;
+			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
+				break;
 			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
 						  ev, sizeof(*ev));
 			if (err == -EAGAIN && --retries < 0) {
-- 
2.44.0


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

* Re: [PATCH] scsi: iscsi: special case for GET_HOST_STATS
  2025-01-03 11:11 [PATCH] scsi: iscsi: special case for GET_HOST_STATS Xiang Zhang
@ 2025-01-03 18:46 ` michael.christie
  2025-01-06  4:16   ` [PATCH v2] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request Xiang Zhang
  0 siblings, 1 reply; 9+ messages in thread
From: michael.christie @ 2025-01-03 18:46 UTC (permalink / raw)
  To: Xiang Zhang, lduncan, cleech, James.Bottomley, martin.petersen
  Cc: linux-scsi, linux-kernel

On 1/3/25 5:11 AM, Xiang Zhang wrote:
> Special case for ISCSI_UEVENT_GET_HOST_STATS:
> - On success: send reply and stats from iscsi_get_host_stats()
>   within if_recv_msg().
> - On error: fall through.

Could you add a line about what is being fixed? The above info describes
how you fixed it.

> > Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
> ---
>  drivers/scsi/scsi_transport_iscsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index fde7de3b1e55..ad4186da1cb4 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)

Patch looks correct, but could you update the code comment right above
this line so it mentions ISCSI_UEVENT_GET_STATS and
ISCSI_UEVENT_GET_HOST_STATS.


>  				break;
>  			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
>  				break;
> +			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
> +				break;
>  			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
>  						  ev, sizeof(*ev));
>  			if (err == -EAGAIN && --retries < 0) {


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

* [PATCH v2] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
  2025-01-03 18:46 ` michael.christie
@ 2025-01-06  4:16   ` Xiang Zhang
  2025-01-06 21:03     ` Mike Christie
  0 siblings, 1 reply; 9+ messages in thread
From: Xiang Zhang @ 2025-01-06  4:16 UTC (permalink / raw)
  To: michael.christie
  Cc: linux-scsi, linux-kernel, Xiang Zhang, Lee Duncan, Chris Leech,
	James E.J. Bottomley, Martin K. Petersen, open-iscsi

The ISCSI_UEVENT_GET_HOST_STATS request is already replied to iscsid in iscsi_get_host_stats,
This fix ensures that redundant responses are skipped in iscsi_if_rx.
- On success: send reply and stats from iscsi_get_host_stats()
  within if_recv_msg().
- On error: fall through.

Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
---
V1 -> V2: Update commit message
---
 drivers/scsi/scsi_transport_iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index fde7de3b1e55..ad4186da1cb4 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
 				break;
 			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
 				break;
+			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
+				break;
 			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
 						  ev, sizeof(*ev));
 			if (err == -EAGAIN && --retries < 0) {
-- 
2.44.0


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

* Re: [PATCH v2] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
  2025-01-06  4:16   ` [PATCH v2] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request Xiang Zhang
@ 2025-01-06 21:03     ` Mike Christie
  2025-01-07  2:24       ` [PATCH v3] " Xiang Zhang
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Christie @ 2025-01-06 21:03 UTC (permalink / raw)
  To: Xiang Zhang
  Cc: linux-scsi, linux-kernel, Lee Duncan, Chris Leech,
	James E.J. Bottomley, Martin K. Petersen, open-iscsi

On 1/5/25 10:16 PM, Xiang Zhang wrote:
> The ISCSI_UEVENT_GET_HOST_STATS request is already replied to iscsid in iscsi_get_host_stats,

The lines are too long. You need to keep them shorter than 75 columns
in the commit message.

You can quickly check your patch by running:

src/linux$ scripts/checkpatch.pl your-patch.patch

Also don't forget the code comment below.

> @@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
>  				break;

Thanks for the update, but I think you missed the previous email:


Patch looks correct, but could you update the code comment right above
this line so it mentions ISCSI_UEVENT_GET_STATS and
ISCSI_UEVENT_GET_HOST_STATS.


>  			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
>  				break;
> +			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
> +				break;
>  			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
>  						  ev, sizeof(*ev));
>  			if (err == -EAGAIN && --retries < 0) {


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

* [PATCH v3] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
  2025-01-06 21:03     ` Mike Christie
@ 2025-01-07  2:24       ` Xiang Zhang
  2025-01-08  1:48         ` michael.christie
  2025-01-10 21:15         ` Martin K. Petersen
  0 siblings, 2 replies; 9+ messages in thread
From: Xiang Zhang @ 2025-01-07  2:24 UTC (permalink / raw)
  To: michael.christie
  Cc: linux-scsi, linux-kernel, Xiang Zhang, Lee Duncan, Chris Leech,
	James E.J. Bottomley, Martin K. Petersen, open-iscsi

The ISCSI_UEVENT_GET_HOST_STATS request is already replied to
iscsid in iscsi_get_host_stats. This fix ensures
that redundant responses are skipped in iscsi_if_rx.
- On success: send reply and stats from iscsi_get_host_stats()
  within if_recv_msg().
- On error: fall through.

Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>
---
V2 -> V3: Update code comments
V1 -> V2: Update commit message
---
 drivers/scsi/scsi_transport_iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index fde7de3b1e55..9b47f91c5b97 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4104,7 +4104,7 @@ iscsi_if_rx(struct sk_buff *skb)
 		}
 		do {
 			/*
-			 * special case for GET_STATS:
+			 * special case for GET_STATS, GET_CHAP and GET_HOST_STATS:
 			 * on success - sending reply and stats from
 			 * inside of if_recv_msg(),
 			 * on error - fall through.
@@ -4113,6 +4113,8 @@ iscsi_if_rx(struct sk_buff *skb)
 				break;
 			if (ev->type == ISCSI_UEVENT_GET_CHAP && !err)
 				break;
+			if (ev->type == ISCSI_UEVENT_GET_HOST_STATS && !err)
+				break;
 			err = iscsi_if_send_reply(portid, nlh->nlmsg_type,
 						  ev, sizeof(*ev));
 			if (err == -EAGAIN && --retries < 0) {
-- 
2.44.0


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

* Re: [PATCH v3] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
  2025-01-07  2:24       ` [PATCH v3] " Xiang Zhang
@ 2025-01-08  1:48         ` michael.christie
  2025-01-10 21:15         ` Martin K. Petersen
  1 sibling, 0 replies; 9+ messages in thread
From: michael.christie @ 2025-01-08  1:48 UTC (permalink / raw)
  To: Xiang Zhang
  Cc: linux-scsi, linux-kernel, Lee Duncan, Chris Leech,
	James E.J. Bottomley, Martin K. Petersen, open-iscsi

On 1/6/25 8:24 PM, Xiang Zhang wrote:
> The ISCSI_UEVENT_GET_HOST_STATS request is already replied to
> iscsid in iscsi_get_host_stats. This fix ensures
> that redundant responses are skipped in iscsi_if_rx.
> - On success: send reply and stats from iscsi_get_host_stats()
>   within if_recv_msg().
> - On error: fall through.
> 
> Signed-off-by: Xiang Zhang <hawkxiang.cpp@gmail.com>

Thanks for fixing this.

Reviewed-by: Mike Christie <michael.christie@oracle.com>

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

* Re: [PATCH v3] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
  2025-01-07  2:24       ` [PATCH v3] " Xiang Zhang
  2025-01-08  1:48         ` michael.christie
@ 2025-01-10 21:15         ` Martin K. Petersen
  1 sibling, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2025-01-10 21:15 UTC (permalink / raw)
  To: michael.christie, Xiang Zhang
  Cc: Martin K . Petersen, linux-scsi, linux-kernel, Lee Duncan,
	Chris Leech, James E.J. Bottomley, open-iscsi

On Tue, 07 Jan 2025 10:24:31 +0800, Xiang Zhang wrote:

> The ISCSI_UEVENT_GET_HOST_STATS request is already replied to
> iscsid in iscsi_get_host_stats. This fix ensures
> that redundant responses are skipped in iscsi_if_rx.
> - On success: send reply and stats from iscsi_get_host_stats()
>   within if_recv_msg().
> - On error: fall through.
> 
> [...]

Applied to 6.13/scsi-fixes, thanks!

[1/1] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
      https://git.kernel.org/mkp/scsi/c/63ca02221cc5

-- 
Martin K. Petersen	Oracle Linux Engineering

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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 11:11 [PATCH] scsi: iscsi: special case for GET_HOST_STATS Xiang Zhang
2025-01-03 18:46 ` michael.christie
2025-01-06  4:16   ` [PATCH v2] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request Xiang Zhang
2025-01-06 21:03     ` Mike Christie
2025-01-07  2:24       ` [PATCH v3] " Xiang Zhang
2025-01-08  1:48         ` michael.christie
2025-01-10 21:15         ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2024-11-11  6:21 [PATCH] scsi: iscsi: special case for GET_HOST_STATS Xiang Zhang
2024-11-03  7:02 Xiang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).