linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/5] Drivers: hv: Miscellaneous fixes
@ 2018-10-18  5:08 kys
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
  0 siblings, 1 reply; 18+ messages in thread
From: kys @ 2018-10-18  5:08 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: K. Y. Srinivasan

From: "K. Y. Srinivasan" <kys@microsoft.com>

Miscellaneous fixes.

V2: Addressed comments from Greg.

Dexuan Cui (3):
  Drivers: hv: kvp: Fix the recent regression caused by incorrect
    clean-up
  Drivers: hv: kvp: Use %u to print U32
  Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1

Haiyang Zhang (1):
  hv_utils: update name in struct hv_driver util_drv

K. Y. Srinivasan (1):
  Drivers: hv: vmbus: Get rid of unnecessary state in hv_context

 drivers/hv/hv.c           | 10 +++-------
 drivers/hv/hv_kvp.c       | 28 +++++++++++++++++++++++-----
 drivers/hv/hv_util.c      |  2 +-
 drivers/hv/hyperv_vmbus.h |  2 --
 tools/hv/hv_kvp_daemon.c  | 15 +++++++++++++--
 5 files changed, 40 insertions(+), 17 deletions(-)

-- 
2.18.0


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

* [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context
  2018-10-18  5:08 [PATCH V2 0/5] Drivers: hv: Miscellaneous fixes kys
@ 2018-10-18  5:09 ` kys
  2018-10-18  5:09   ` [PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv kys
                     ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: kys @ 2018-10-18  5:09 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: K. Y. Srinivasan

From: "K. Y. Srinivasan" <kys@microsoft.com>

Currently we are replicating state in struct hv_context that is unnecessary -
this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu
state that is being maintained as a global state in struct hv_context.
Get rid of this state in struct hv_context.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv.c           | 10 +++-------
 drivers/hv/hyperv_vmbus.h |  2 --
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 332d7c34be5c..166c2501de17 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -33,9 +33,7 @@
 #include "hyperv_vmbus.h"
 
 /* The one and only */
-struct hv_context hv_context = {
-	.synic_initialized	= false,
-};
+struct hv_context hv_context;
 
 /*
  * If false, we're using the old mechanism for stimer0 interrupts
@@ -326,8 +324,6 @@ int hv_synic_init(unsigned int cpu)
 
 	hv_set_synic_state(sctrl.as_uint64);
 
-	hv_context.synic_initialized = true;
-
 	/*
 	 * Register the per-cpu clockevent source.
 	 */
@@ -373,7 +369,8 @@ int hv_synic_cleanup(unsigned int cpu)
 	bool channel_found = false;
 	unsigned long flags;
 
-	if (!hv_context.synic_initialized)
+	hv_get_synic_state(sctrl.as_uint64);
+	if (sctrl.enable != 1)
 		return -EFAULT;
 
 	/*
@@ -435,7 +432,6 @@ int hv_synic_cleanup(unsigned int cpu)
 	hv_set_siefp(siefp.as_uint64);
 
 	/* Disable the global synic bit */
-	hv_get_synic_state(sctrl.as_uint64);
 	sctrl.enable = 0;
 	hv_set_synic_state(sctrl.as_uint64);
 
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 72eaba3d50fc..f17c06a5e74b 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -230,8 +230,6 @@ struct hv_context {
 
 	void *tsc_page;
 
-	bool synic_initialized;
-
 	struct hv_per_cpu_context __percpu *cpu_context;
 
 	/*
-- 
2.18.0


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

* [PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
@ 2018-10-18  5:09   ` kys
  2018-10-18  5:09   ` [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up kys
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: kys @ 2018-10-18  5:09 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: Haiyang Zhang, K . Y . Srinivasan

From: Haiyang Zhang <haiyangz@microsoft.com>

The correct module name is hv_utils. This patch corrects
the name in struct hv_driver util_drv.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 423205077bf6..f10eeb120c8b 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -483,7 +483,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
 /* The one and only one */
 static  struct hv_driver util_drv = {
-	.name = "hv_util",
+	.name = "hv_utils",
 	.id_table = id_table,
 	.probe =  util_probe,
 	.remove =  util_remove,
-- 
2.18.0


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

* [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
  2018-10-18  5:09   ` [PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv kys
@ 2018-10-18  5:09   ` kys
  2018-10-24 15:37     ` Michael Kelley
  2018-11-01 19:38     ` Haiyang Zhang
  2018-10-18  5:09   ` [PATCH V2 4/5] Drivers: hv: kvp: Use %u to print U32 kys
                     ` (2 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: kys @ 2018-10-18  5:09 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: Dexuan Cui, K . Y . Srinivasan, Haiyang Zhang, Stable

From: Dexuan Cui <decui@microsoft.com>

In kvp_send_key(), we do need call process_ib_ipinfo() if
message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
the userland hv_kvp_daemon needs the info of operation, adapter_id and
addr_family. With the incorrect fc62c3b1977d, the host can't get the
VM's IP via KVP.

And, fc62c3b1977d added a "break;", but actually forgot to initialize
the key_size/value in the case of KVP_OP_SET, so the default key_size of
0 is passed to the kvp daemon, and the pool files
/var/lib/hyperv/.kvp_pool_* can't be updated.

This patch effectively rolls back the previous fc62c3b1977d, and
correctly fixes the "this statement may fall through" warnings.

This patch is tested on WS 2012 R2 and 2016.

Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall through" warnings")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index a7513a8a8e37..d6106e1a0d4a 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -353,6 +353,9 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, int op)
 
 		out->body.kvp_ip_val.dhcp_enabled = in->kvp_ip_val.dhcp_enabled;
 
+		/* fallthrough */
+
+	case KVP_OP_GET_IP_INFO:
 		utf16s_to_utf8s((wchar_t *)in->kvp_ip_val.adapter_id,
 				MAX_ADAPTER_ID_SIZE,
 				UTF16_LITTLE_ENDIAN,
@@ -405,7 +408,11 @@ kvp_send_key(struct work_struct *dummy)
 		process_ib_ipinfo(in_msg, message, KVP_OP_SET_IP_INFO);
 		break;
 	case KVP_OP_GET_IP_INFO:
-		/* We only need to pass on message->kvp_hdr.operation.  */
+		/*
+		 * We only need to pass on the info of operation, adapter_id
+		 * and addr_family to the userland kvp daemon.
+		 */
+		process_ib_ipinfo(in_msg, message, KVP_OP_GET_IP_INFO);
 		break;
 	case KVP_OP_SET:
 		switch (in_msg->body.kvp_set.data.value_type) {
@@ -446,9 +453,9 @@ kvp_send_key(struct work_struct *dummy)
 
 		}
 
-		break;
-
-	case KVP_OP_GET:
+		/*
+		 * The key is always a string - utf16 encoding.
+		 */
 		message->body.kvp_set.data.key_size =
 			utf16s_to_utf8s(
 			(wchar_t *)in_msg->body.kvp_set.data.key,
@@ -456,6 +463,17 @@ kvp_send_key(struct work_struct *dummy)
 			UTF16_LITTLE_ENDIAN,
 			message->body.kvp_set.data.key,
 			HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1) + 1;
+
+		break;
+
+	case KVP_OP_GET:
+		message->body.kvp_get.data.key_size =
+			utf16s_to_utf8s(
+			(wchar_t *)in_msg->body.kvp_get.data.key,
+			in_msg->body.kvp_get.data.key_size,
+			UTF16_LITTLE_ENDIAN,
+			message->body.kvp_get.data.key,
+			HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1) + 1;
 		break;
 
 	case KVP_OP_DELETE:
-- 
2.18.0


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

* [PATCH V2 4/5] Drivers: hv: kvp: Use %u to print U32
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
  2018-10-18  5:09   ` [PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv kys
  2018-10-18  5:09   ` [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up kys
@ 2018-10-18  5:09   ` kys
  2018-10-18  5:09   ` [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 kys
  2018-10-24 15:04   ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context Michael Kelley
  4 siblings, 0 replies; 18+ messages in thread
From: kys @ 2018-10-18  5:09 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: Dexuan Cui, K . Y . Srinivasan, Haiyang Zhang

From: Dexuan Cui <decui@microsoft.com>

I didn't find a real issue. Let's just make it consistent with the
next "case REG_U64:" where %llu is used.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_kvp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index d6106e1a0d4a..5054d1105236 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -437,7 +437,7 @@ kvp_send_key(struct work_struct *dummy)
 			val32 = in_msg->body.kvp_set.data.value_u32;
 			message->body.kvp_set.data.value_size =
 				sprintf(message->body.kvp_set.data.value,
-					"%d", val32) + 1;
+					"%u", val32) + 1;
 			break;
 
 		case REG_U64:
-- 
2.18.0


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

* [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
                     ` (2 preceding siblings ...)
  2018-10-18  5:09   ` [PATCH V2 4/5] Drivers: hv: kvp: Use %u to print U32 kys
@ 2018-10-18  5:09   ` kys
  2018-10-18  6:32     ` Dan Carpenter
  2018-10-24 15:04   ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context Michael Kelley
  4 siblings, 1 reply; 18+ messages in thread
From: kys @ 2018-10-18  5:09 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets
  Cc: Dexuan Cui, K . Y . Srinivasan, Haiyang Zhang

From: Dexuan Cui <decui@microsoft.com>

The patch fixes:

hv_kvp_daemon.c: In function 'kvp_set_ip_info':
hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes
into a destination of size 4096

The "(unsigned int)str_len" is to avoid:

hv_kvp_daemon.c:1309:30: warning: comparison of integer expressions of
different signedness: 'int' and 'long unsigned int' [-Wsign-compare]

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 tools/hv/hv_kvp_daemon.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index bbb2a8ef367c..d7e06fe0270e 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -1178,6 +1178,7 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
 	FILE *file;
 	char cmd[PATH_MAX];
 	char *mac_addr;
+	int str_len;
 
 	/*
 	 * Set the configuration for the specified interface with
@@ -1301,8 +1302,18 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
 	 * invoke the external script to do its magic.
 	 */
 
-	snprintf(cmd, sizeof(cmd), KVP_SCRIPTS_PATH "%s %s",
-		 "hv_set_ifconfig", if_file);
+	str_len = snprintf(cmd, sizeof(cmd), KVP_SCRIPTS_PATH "%s %s",
+			   "hv_set_ifconfig", if_file);
+	/*
+	 * This is a little overcautious, but it's necessary to suppress some
+	 * false warnings from gcc 8.0.1.
+	 */
+	if (str_len <= 0 || (unsigned int)str_len >= sizeof(cmd)) {
+		syslog(LOG_ERR, "Cmd '%s' (len=%d) may be too long",
+		       cmd, str_len);
+		return HV_E_FAIL;
+	}
+
 	if (system(cmd)) {
 		syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s",
 				cmd, errno, strerror(errno));
-- 
2.18.0


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

* Re: [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1
  2018-10-18  5:09   ` [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 kys
@ 2018-10-18  6:32     ` Dan Carpenter
  2018-10-18 15:08       ` David Laight
  0 siblings, 1 reply; 18+ messages in thread
From: Dan Carpenter @ 2018-10-18  6:32 UTC (permalink / raw)
  To: kys
  Cc: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets, Haiyang Zhang

On Thu, Oct 18, 2018 at 05:09:32AM +0000, kys@linuxonhyperv.com wrote:
> From: Dexuan Cui <decui@microsoft.com>
> 
> The patch fixes:
> 
> hv_kvp_daemon.c: In function 'kvp_set_ip_info':
> hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes
> into a destination of size 4096
> 
> The "(unsigned int)str_len" is to avoid:
> 
> hv_kvp_daemon.c:1309:30: warning: comparison of integer expressions of
> different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
> 

Ugh...  Any tool with the most basic flow analysis would realize this
was a false positive.  We use at least three static analyzers which
catch signedness bugs.  Can we turn off GCC's warning on this until they
improve it a bit?

regards,
dan carpenter


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

* RE: [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1
  2018-10-18  6:32     ` Dan Carpenter
@ 2018-10-18 15:08       ` David Laight
  0 siblings, 0 replies; 18+ messages in thread
From: David Laight @ 2018-10-18 15:08 UTC (permalink / raw)
  To: 'Dan Carpenter', kys
  Cc: gregkh, linux-kernel, devel, olaf, apw, jasowang, sthemmin,
	Michael.H.Kelley, vkuznets, Haiyang Zhang

From: Dan Carpenter
> Sent: 18 October 2018 07:33
> 
> On Thu, Oct 18, 2018 at 05:09:32AM +0000, kys@linuxonhyperv.com wrote:
> > From: Dexuan Cui <decui@microsoft.com>
> >
> > The patch fixes:
> >
> > hv_kvp_daemon.c: In function 'kvp_set_ip_info':
> > hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes
> > into a destination of size 4096
> >
> > The "(unsigned int)str_len" is to avoid:
> >
> > hv_kvp_daemon.c:1309:30: warning: comparison of integer expressions of
> > different signedness: 'int' and 'long unsigned int' [-Wsign-compare]

I usually use 'str_len + 0u' rather than a cast.

> Ugh...  Any tool with the most basic flow analysis would realize this
> was a false positive.  We use at least three static analyzers which
> catch signedness bugs.  Can we turn off GCC's warning on this until they
> improve it a bit?

Yes, would be nice if it attempted to follow the valid domain of variables.

I recently had to change:
	unsigned char a, b;
	unsigned int c;
	...
	if (a + b < c)
To stop a 'signedness' warning.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* RE: [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context
  2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
                     ` (3 preceding siblings ...)
  2018-10-18  5:09   ` [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 kys
@ 2018-10-24 15:04   ` Michael Kelley
  4 siblings, 0 replies; 18+ messages in thread
From: Michael Kelley @ 2018-10-24 15:04 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, olaf, apw, jasowang,
	Stephen Hemminger, vkuznets

From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent: Wednesday, October 17, 2018 10:09 PM
> 
> Currently we are replicating state in struct hv_context that is unnecessary -
> this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu
> state that is being maintained as a global state in struct hv_context.
> Get rid of this state in struct hv_context.
> 
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  drivers/hv/hv.c           | 10 +++-------
>  drivers/hv/hyperv_vmbus.h |  2 --
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
Reviewed-by: Michael Kelley <mikelley@microsoft.com>

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-10-18  5:09   ` [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up kys
@ 2018-10-24 15:37     ` Michael Kelley
  2018-10-31 23:23       ` Dexuan Cui
  2018-11-01 19:38     ` Haiyang Zhang
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Kelley @ 2018-10-24 15:37 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, olaf, apw, jasowang,
	Stephen Hemminger, vkuznets
  Cc: Dexuan Cui, Haiyang Zhang, Stable

From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent: Wednesday, October 17, 2018 10:10 PM
> From: Dexuan Cui <decui@microsoft.com>
> 
> In kvp_send_key(), we do need call process_ib_ipinfo() if
> message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
> the userland hv_kvp_daemon needs the info of operation, adapter_id and
> addr_family. With the incorrect fc62c3b1977d, the host can't get the
> VM's IP via KVP.
> 
> And, fc62c3b1977d added a "break;", but actually forgot to initialize
> the key_size/value in the case of KVP_OP_SET, so the default key_size of
> 0 is passed to the kvp daemon, and the pool files
> /var/lib/hyperv/.kvp_pool_* can't be updated.
> 
> This patch effectively rolls back the previous fc62c3b1977d, and
> correctly fixes the "this statement may fall through" warnings.
> 
> This patch is tested on WS 2012 R2 and 2016.
> 
> Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall through" warnings")
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: <Stable@vger.kernel.org>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
>  1 file changed, 22 insertions(+), 4 deletions(-)
> 
Reviewed-by: Michael Kelley <mikelley@microsoft.com>

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-10-24 15:37     ` Michael Kelley
@ 2018-10-31 23:23       ` Dexuan Cui
  2018-11-01 18:56         ` gregkh
  0 siblings, 1 reply; 18+ messages in thread
From: Dexuan Cui @ 2018-10-31 23:23 UTC (permalink / raw)
  To: Michael Kelley, KY Srinivasan, gregkh, linux-kernel, devel, olaf,
	apw, jasowang, Stephen Hemminger, vkuznets, Sasha Levin
  Cc: Haiyang Zhang, Stable

> From: Michael Kelley <mikelley@microsoft.com>
> Sent: Wednesday, October 24, 2018 08:38
> From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent: Wednesday,
> October 17, 2018 10:10 PM
> > From: Dexuan Cui <decui@microsoft.com>
> >
> > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
> > the userland hv_kvp_daemon needs the info of operation, adapter_id and
> > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > VM's IP via KVP.
> >
> > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > the key_size/value in the case of KVP_OP_SET, so the default key_size of
> > 0 is passed to the kvp daemon, and the pool files
> > /var/lib/hyperv/.kvp_pool_* can't be updated.
> >
> > This patch effectively rolls back the previous fc62c3b1977d, and
> > correctly fixes the "this statement may fall through" warnings.
> >
> > This patch is tested on WS 2012 R2 and 2016.
> >
> > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> through" warnings")
> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > Cc: <Stable@vger.kernel.org>
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > ---
> >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> >  1 file changed, 22 insertions(+), 4 deletions(-)
> >
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>

Hi Greg,
Can you please take a look at this patch?

We need it to fix a regression introduced by me in:
Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall through" warnings")

The faulty patch is being meged into the old stable kernels... So we need to
take this patch ASAP. Thanks!

-- Dexuan

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

* Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-10-31 23:23       ` Dexuan Cui
@ 2018-11-01 18:56         ` gregkh
  2018-11-01 19:22           ` Dexuan Cui
  2018-11-02 21:55           ` KY Srinivasan
  0 siblings, 2 replies; 18+ messages in thread
From: gregkh @ 2018-11-01 18:56 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Michael Kelley, KY Srinivasan, linux-kernel, devel, olaf, apw,
	jasowang, Stephen Hemminger, vkuznets, Sasha Levin,
	Haiyang Zhang, Stable

On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > From: Michael Kelley <mikelley@microsoft.com>
> > Sent: Wednesday, October 24, 2018 08:38
> > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent: Wednesday,
> > October 17, 2018 10:10 PM
> > > From: Dexuan Cui <decui@microsoft.com>
> > >
> > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
> > > the userland hv_kvp_daemon needs the info of operation, adapter_id and
> > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > VM's IP via KVP.
> > >
> > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > the key_size/value in the case of KVP_OP_SET, so the default key_size of
> > > 0 is passed to the kvp daemon, and the pool files
> > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > >
> > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > correctly fixes the "this statement may fall through" warnings.
> > >
> > > This patch is tested on WS 2012 R2 and 2016.
> > >
> > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> > through" warnings")
> > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > Cc: <Stable@vger.kernel.org>
> > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > ---
> > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > >
> > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> 
> Hi Greg,
> Can you please take a look at this patch?

Nope, I'm not the hv maintainer, they need to look at this and ack it,
not me :)

greg k-h

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-11-01 18:56         ` gregkh
@ 2018-11-01 19:22           ` Dexuan Cui
  2018-11-02  4:54             ` gregkh
  2018-11-02 21:55           ` KY Srinivasan
  1 sibling, 1 reply; 18+ messages in thread
From: Dexuan Cui @ 2018-11-01 19:22 UTC (permalink / raw)
  To: gregkh
  Cc: Michael Kelley, KY Srinivasan, linux-kernel, devel, olaf, apw,
	jasowang, Stephen Hemminger, vkuznets, Sasha Levin,
	Haiyang Zhang, Stable

> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Thursday, November 1, 2018 11:57
> To: Dexuan Cui <decui@microsoft.com>
> 
> On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > > From: Michael Kelley <mikelley@microsoft.com>
> > > Sent: Wednesday, October 24, 2018 08:38
> > > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent:
> Wednesday,
> > > October 17, 2018 10:10 PM
> > > > From: Dexuan Cui <decui@microsoft.com>
> > > >
> > > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns
> out
> > > > the userland hv_kvp_daemon needs the info of operation, adapter_id
> and
> > > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > > VM's IP via KVP.
> > > >
> > > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > > the key_size/value in the case of KVP_OP_SET, so the default key_size of
> > > > 0 is passed to the kvp daemon, and the pool files
> > > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > > >
> > > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > > correctly fixes the "this statement may fall through" warnings.
> > > >
> > > > This patch is tested on WS 2012 R2 and 2016.
> > > >
> > > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> > > through" warnings")
> > > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > > Cc: <Stable@vger.kernel.org>
> > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > ---
> > > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > > >
> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> >
> > Hi Greg,
> > Can you please take a look at this patch?
> 
> Nope, I'm not the hv maintainer, they need to look at this and ack it,
> not me :)
> 
> greg k-h

Hi Greg,
KY has added his Signed-off-by in the mail.

I'll ask the other HV maintainers to take a look as well.

Thanks,
-- Dexuan

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-10-18  5:09   ` [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up kys
  2018-10-24 15:37     ` Michael Kelley
@ 2018-11-01 19:38     ` Haiyang Zhang
  1 sibling, 0 replies; 18+ messages in thread
From: Haiyang Zhang @ 2018-11-01 19:38 UTC (permalink / raw)
  To: KY Srinivasan, gregkh, linux-kernel, devel, olaf, apw, jasowang,
	Stephen Hemminger, Michael Kelley, vkuznets
  Cc: Dexuan Cui, Stable



> -----Original Message-----
> From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>
> Sent: Thursday, October 18, 2018 1:10 AM
> To: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; Stephen Hemminger <sthemmin@microsoft.com>;
> Michael Kelley <mikelley@microsoft.com>; vkuznets <vkuznets@redhat.com>
> Cc: Dexuan Cui <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>;
> Haiyang Zhang <haiyangz@microsoft.com>; Stable@vger.kernel.org
> Subject: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by
> incorrect clean-up
> 
> From: Dexuan Cui <decui@microsoft.com>
> 
> In kvp_send_key(), we do need call process_ib_ipinfo() if
> message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
> the userland hv_kvp_daemon needs the info of operation, adapter_id and
> addr_family. With the incorrect fc62c3b1977d, the host can't get the VM's IP
> via KVP.
> 
> And, fc62c3b1977d added a "break;", but actually forgot to initialize the
> key_size/value in the case of KVP_OP_SET, so the default key_size of
> 0 is passed to the kvp daemon, and the pool files
> /var/lib/hyperv/.kvp_pool_* can't be updated.
> 
> This patch effectively rolls back the previous fc62c3b1977d, and correctly fixes
> the "this statement may fall through" warnings.
> 
> This patch is tested on WS 2012 R2 and 2016.
> 
> Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> through" warnings")
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: <Stable@vger.kernel.org>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>

Thanks!


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

* Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-11-01 19:22           ` Dexuan Cui
@ 2018-11-02  4:54             ` gregkh
  2018-11-11  4:18               ` Dexuan Cui
  0 siblings, 1 reply; 18+ messages in thread
From: gregkh @ 2018-11-02  4:54 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Michael Kelley, KY Srinivasan, linux-kernel, devel, olaf, apw,
	jasowang, Stephen Hemminger, vkuznets, Sasha Levin,
	Haiyang Zhang, Stable

On Thu, Nov 01, 2018 at 07:22:28PM +0000, Dexuan Cui wrote:
> > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > Sent: Thursday, November 1, 2018 11:57
> > To: Dexuan Cui <decui@microsoft.com>
> > 
> > On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > > > From: Michael Kelley <mikelley@microsoft.com>
> > > > Sent: Wednesday, October 24, 2018 08:38
> > > > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent:
> > Wednesday,
> > > > October 17, 2018 10:10 PM
> > > > > From: Dexuan Cui <decui@microsoft.com>
> > > > >
> > > > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns
> > out
> > > > > the userland hv_kvp_daemon needs the info of operation, adapter_id
> > and
> > > > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > > > VM's IP via KVP.
> > > > >
> > > > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > > > the key_size/value in the case of KVP_OP_SET, so the default key_size of
> > > > > 0 is passed to the kvp daemon, and the pool files
> > > > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > > > >
> > > > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > > > correctly fixes the "this statement may fall through" warnings.
> > > > >
> > > > > This patch is tested on WS 2012 R2 and 2016.
> > > > >
> > > > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> > > > through" warnings")
> > > > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > > > Cc: <Stable@vger.kernel.org>
> > > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > > ---
> > > > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > > > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > > > >
> > > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> > >
> > > Hi Greg,
> > > Can you please take a look at this patch?
> > 
> > Nope, I'm not the hv maintainer, they need to look at this and ack it,
> > not me :)
> > 
> > greg k-h
> 
> Hi Greg,
> KY has added his Signed-off-by in the mail.
> 
> I'll ask the other HV maintainers to take a look as well.

Ok, then I'll look at it after 4.20-rc1 is out, nothing I can do until
then anyway...

thanks,

greg k-h

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-11-01 18:56         ` gregkh
  2018-11-01 19:22           ` Dexuan Cui
@ 2018-11-02 21:55           ` KY Srinivasan
  1 sibling, 0 replies; 18+ messages in thread
From: KY Srinivasan @ 2018-11-02 21:55 UTC (permalink / raw)
  To: gregkh, Dexuan Cui
  Cc: Michael Kelley, linux-kernel, devel, olaf, apw, jasowang,
	Stephen Hemminger, vkuznets, Sasha Levin, Haiyang Zhang, Stable



> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Thursday, November 1, 2018 11:57 AM
> To: Dexuan Cui <decui@microsoft.com>
> Cc: Michael Kelley <mikelley@microsoft.com>; KY Srinivasan
> <kys@microsoft.com>; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; Stephen Hemminger <sthemmin@microsoft.com>;
> vkuznets <vkuznets@redhat.com>; Sasha Levin
> <Alexander.Levin@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Stable@vger.kernel.org
> Subject: Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused
> by incorrect clean-up
> 
> On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > > From: Michael Kelley <mikelley@microsoft.com>
> > > Sent: Wednesday, October 24, 2018 08:38
> > > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent:
> Wednesday,
> > > October 17, 2018 10:10 PM
> > > > From: Dexuan Cui <decui@microsoft.com>
> > > >
> > > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it
> turns out
> > > > the userland hv_kvp_daemon needs the info of operation, adapter_id
> and
> > > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > > VM's IP via KVP.
> > > >
> > > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > > the key_size/value in the case of KVP_OP_SET, so the default key_size
> of
> > > > 0 is passed to the kvp daemon, and the pool files
> > > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > > >
> > > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > > correctly fixes the "this statement may fall through" warnings.
> > > >
> > > > This patch is tested on WS 2012 R2 and 2016.
> > > >
> > > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall
> > > through" warnings")
> > > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > > Cc: <Stable@vger.kernel.org>
> > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > ---
> > > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > > >
> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> >
> > Hi Greg,
> > Can you please take a look at this patch?

Greg,

I have already signed-off on this patch.

K. Y
> 
> Nope, I'm not the hv maintainer, they need to look at this and ack it,
> not me :)
> 
> greg k-h

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

* RE: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-11-02  4:54             ` gregkh
@ 2018-11-11  4:18               ` Dexuan Cui
  2018-11-11 17:09                 ` gregkh
  0 siblings, 1 reply; 18+ messages in thread
From: Dexuan Cui @ 2018-11-11  4:18 UTC (permalink / raw)
  To: gregkh
  Cc: Michael Kelley, KY Srinivasan, linux-kernel, devel, olaf, apw,
	jasowang, Stephen Hemminger, vkuznets, Sasha Levin,
	Haiyang Zhang, Stable

> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Thursday, November 1, 2018 21:54
> To: Dexuan Cui <decui@microsoft.com>
> Cc: Michael Kelley <mikelley@microsoft.com>; KY Srinivasan
> <kys@microsoft.com>; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; Stephen Hemminger <sthemmin@microsoft.com>;
> vkuznets <vkuznets@redhat.com>; Sasha Levin
> <Alexander.Levin@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>;
> Stable@vger.kernel.org
> Subject: Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused
> by incorrect clean-up
> 
> On Thu, Nov 01, 2018 at 07:22:28PM +0000, Dexuan Cui wrote:
> > > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > > Sent: Thursday, November 1, 2018 11:57
> > > To: Dexuan Cui <decui@microsoft.com>
> > >
> > > On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > > > > From: Michael Kelley <mikelley@microsoft.com>
> > > > > Sent: Wednesday, October 24, 2018 08:38
> > > > > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent:
> > > Wednesday,
> > > > > October 17, 2018 10:10 PM
> > > > > > From: Dexuan Cui <decui@microsoft.com>
> > > > > >
> > > > > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > > > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it
> turns
> > > out
> > > > > > the userland hv_kvp_daemon needs the info of operation, adapter_id
> > > and
> > > > > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > > > > VM's IP via KVP.
> > > > > >
> > > > > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > > > > the key_size/value in the case of KVP_OP_SET, so the default key_size
> of
> > > > > > 0 is passed to the kvp daemon, and the pool files
> > > > > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > > > > >
> > > > > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > > > > correctly fixes the "this statement may fall through" warnings.
> > > > > >
> > > > > > This patch is tested on WS 2012 R2 and 2016.
> > > > > >
> > > > > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may
> fall
> > > > > through" warnings")
> > > > > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > > > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > > > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > > > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > > > > Cc: <Stable@vger.kernel.org>
> > > > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > > > ---
> > > > > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > > > > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > > > > >
> > > > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> > > >
> > > > Hi Greg,
> > > > Can you please take a look at this patch?
> > >
> > > Nope, I'm not the hv maintainer, they need to look at this and ack it,
> > > not me :)
> > >
> > > greg k-h
> >
> > Hi Greg,
> > KY has added his Signed-off-by in the mail.
> >
> > I'll ask the other HV maintainers to take a look as well.
> 
> Ok, then I'll look at it after 4.20-rc1 is out, nothing I can do until
> then anyway...
> 
> thanks,
> 
> greg k-h

Hi Greg,
Can you please take a look at the patch now?

The patch has received

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>

Thanks,
-- Dexuan

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

* Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
  2018-11-11  4:18               ` Dexuan Cui
@ 2018-11-11 17:09                 ` gregkh
  0 siblings, 0 replies; 18+ messages in thread
From: gregkh @ 2018-11-11 17:09 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Michael Kelley, KY Srinivasan, linux-kernel, devel, olaf, apw,
	jasowang, Stephen Hemminger, vkuznets, Sasha Levin,
	Haiyang Zhang, Stable

On Sun, Nov 11, 2018 at 04:18:03AM +0000, Dexuan Cui wrote:
> > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > Sent: Thursday, November 1, 2018 21:54
> > To: Dexuan Cui <decui@microsoft.com>
> > Cc: Michael Kelley <mikelley@microsoft.com>; KY Srinivasan
> > <kys@microsoft.com>; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> > jasowang@redhat.com; Stephen Hemminger <sthemmin@microsoft.com>;
> > vkuznets <vkuznets@redhat.com>; Sasha Levin
> > <Alexander.Levin@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>;
> > Stable@vger.kernel.org
> > Subject: Re: [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused
> > by incorrect clean-up
> > 
> > On Thu, Nov 01, 2018 at 07:22:28PM +0000, Dexuan Cui wrote:
> > > > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > > > Sent: Thursday, November 1, 2018 11:57
> > > > To: Dexuan Cui <decui@microsoft.com>
> > > >
> > > > On Wed, Oct 31, 2018 at 11:23:54PM +0000, Dexuan Cui wrote:
> > > > > > From: Michael Kelley <mikelley@microsoft.com>
> > > > > > Sent: Wednesday, October 24, 2018 08:38
> > > > > > From: kys@linuxonhyperv.com <kys@linuxonhyperv.com>  Sent:
> > > > Wednesday,
> > > > > > October 17, 2018 10:10 PM
> > > > > > > From: Dexuan Cui <decui@microsoft.com>
> > > > > > >
> > > > > > > In kvp_send_key(), we do need call process_ib_ipinfo() if
> > > > > > > message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it
> > turns
> > > > out
> > > > > > > the userland hv_kvp_daemon needs the info of operation, adapter_id
> > > > and
> > > > > > > addr_family. With the incorrect fc62c3b1977d, the host can't get the
> > > > > > > VM's IP via KVP.
> > > > > > >
> > > > > > > And, fc62c3b1977d added a "break;", but actually forgot to initialize
> > > > > > > the key_size/value in the case of KVP_OP_SET, so the default key_size
> > of
> > > > > > > 0 is passed to the kvp daemon, and the pool files
> > > > > > > /var/lib/hyperv/.kvp_pool_* can't be updated.
> > > > > > >
> > > > > > > This patch effectively rolls back the previous fc62c3b1977d, and
> > > > > > > correctly fixes the "this statement may fall through" warnings.
> > > > > > >
> > > > > > > This patch is tested on WS 2012 R2 and 2016.
> > > > > > >
> > > > > > > Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may
> > fall
> > > > > > through" warnings")
> > > > > > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > > > > > Cc: K. Y. Srinivasan <kys@microsoft.com>
> > > > > > > Cc: Haiyang Zhang <haiyangz@microsoft.com>
> > > > > > > Cc: Stephen Hemminger <sthemmin@microsoft.com>
> > > > > > > Cc: <Stable@vger.kernel.org>
> > > > > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > > > > ---
> > > > > > >  drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
> > > > > > >  1 file changed, 22 insertions(+), 4 deletions(-)
> > > > > > >
> > > > > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> > > > >
> > > > > Hi Greg,
> > > > > Can you please take a look at this patch?
> > > >
> > > > Nope, I'm not the hv maintainer, they need to look at this and ack it,
> > > > not me :)
> > > >
> > > > greg k-h
> > >
> > > Hi Greg,
> > > KY has added his Signed-off-by in the mail.
> > >
> > > I'll ask the other HV maintainers to take a look as well.
> > 
> > Ok, then I'll look at it after 4.20-rc1 is out, nothing I can do until
> > then anyway...
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi Greg,
> Can you please take a look at the patch now?

It's in my queue, sorry, it's big right now due to travel...

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

end of thread, other threads:[~2018-11-11 17:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18  5:08 [PATCH V2 0/5] Drivers: hv: Miscellaneous fixes kys
2018-10-18  5:09 ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context kys
2018-10-18  5:09   ` [PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv kys
2018-10-18  5:09   ` [PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up kys
2018-10-24 15:37     ` Michael Kelley
2018-10-31 23:23       ` Dexuan Cui
2018-11-01 18:56         ` gregkh
2018-11-01 19:22           ` Dexuan Cui
2018-11-02  4:54             ` gregkh
2018-11-11  4:18               ` Dexuan Cui
2018-11-11 17:09                 ` gregkh
2018-11-02 21:55           ` KY Srinivasan
2018-11-01 19:38     ` Haiyang Zhang
2018-10-18  5:09   ` [PATCH V2 4/5] Drivers: hv: kvp: Use %u to print U32 kys
2018-10-18  5:09   ` [PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 kys
2018-10-18  6:32     ` Dan Carpenter
2018-10-18 15:08       ` David Laight
2018-10-24 15:04   ` [PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context Michael Kelley

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).