[3.13.y.z extended stable] Patch "Drivers: hv: vmbus: Cleanup vmbus_post_msg()" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Oct 21 20:09:16 UTC 2014

This is a note to let you know that I have just added a patch titled

    Drivers: hv: vmbus: Cleanup vmbus_post_msg()

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see



>From 170c7fda9d34e0b2e0deff9929ee2ecfcb76c917 Mon Sep 17 00:00:00 2001
From: "K. Y. Srinivasan" <kys at microsoft.com>
Date: Wed, 27 Aug 2014 16:25:31 -0700
Subject: Drivers: hv: vmbus: Cleanup vmbus_post_msg()

commit fdeebcc62279119dbeafbc1a2e39e773839025fd upstream.

Posting messages to the host can fail because of transient resource
related failures. Correctly deal with these failures and increase the
number of attempts to post the message before giving up.

In this version of the patch, I have normalized the error code to
Linux error code.

Signed-off-by: K. Y. Srinivasan <kys at microsoft.com>
Tested-by: Sitsofe Wheeler <sitsofe at yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/hv/connection.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index ce5a9f2..d8fd95c 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -408,10 +408,21 @@ int vmbus_post_msg(void *buffer, size_t buflen)
 	 * insufficient resources. Retry the operation a couple of
 	 * times before giving up.
-	while (retries < 3) {
-		ret =  hv_post_message(conn_id, 1, buffer, buflen);
+	while (retries < 10) {
+		ret = hv_post_message(conn_id, 1, buffer, buflen);
+		switch (ret) {
+			ret = -ENOMEM;
+		case -ENOMEM:
+			break;
 			return ret;
+		default:
+			pr_err("hv_post_msg() failed; error code:%d\n", ret);
+			return -EINVAL;
+		}

More information about the kernel-team mailing list