All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiang Zhang <hawkxiang.cpp@gmail.com>
To: michael.christie@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Xiang Zhang <hawkxiang.cpp@gmail.com>,
	Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	open-iscsi@googlegroups.com
Subject: [PATCH v3] scsi: iscsi: Fix redundant response for ISCSI_UEVENT_GET_HOST_STATS request
Date: Tue,  7 Jan 2025 10:24:31 +0800	[thread overview]
Message-ID: <20250107022432.65390-1-hawkxiang.cpp@gmail.com> (raw)
In-Reply-To: <d9be3663-f6f2-4a1c-bd88-2a3978f92bb1@oracle.com>

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


  reply	other threads:[~2025-01-07  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Xiang Zhang [this message]
2025-01-08  1:48         ` [PATCH v3] " michael.christie
2025-01-10 21:15         ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250107022432.65390-1-hawkxiang.cpp@gmail.com \
    --to=hawkxiang.cpp@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=cleech@redhat.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.