Blame SOURCES/0001-bus-vmbus-fix-race-in-subchannel-creation.patch

8f5e58
From 25363eb99bc43443bec354abea1e40db61280b30 Mon Sep 17 00:00:00 2001
8f5e58
From: Stephen Hemminger <sthemmin@microsoft.com>
8f5e58
Date: Wed, 5 Dec 2018 14:11:56 -0800
8f5e58
Subject: [PATCH 1/3] bus/vmbus: fix race in subchannel creation
8f5e58
8f5e58
[ upstream commit 4970103e89f4f828669acf3b465e984fdc891e1e ]
8f5e58
8f5e58
When using multiple queues, there was a race with the kernel
8f5e58
in setting up the second channel. This regression is due to a kernel change
8f5e58
which does not allow accessing sysfs files for Hyper-V channels that are not opened.
8f5e58
8f5e58
The fix is simple, just move the logic to detect not ready
8f5e58
sub channels earlier in the existing loop.
8f5e58
8f5e58
Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
8f5e58
8f5e58
Reported-by: Mohammed Gamal <mgamal@redhat.com>
8f5e58
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
8f5e58
(cherry picked from commit ca17e6624251b05cf188997cffc3e1ab2e50561a)
8f5e58
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8f5e58
---
8f5e58
 drivers/bus/vmbus/linux/vmbus_uio.c | 12 ++++++------
8f5e58
 1 file changed, 6 insertions(+), 6 deletions(-)
8f5e58
8f5e58
diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c
8f5e58
index 12e97e3a4..38df4d724 100644
8f5e58
--- a/drivers/bus/vmbus/linux/vmbus_uio.c
8f5e58
+++ b/drivers/bus/vmbus/linux/vmbus_uio.c
8f5e58
@@ -357,6 +357,12 @@ int vmbus_uio_get_subchan(struct vmbus_channel *primary,
8f5e58
 			continue;
8f5e58
 		}
8f5e58
 
8f5e58
+		if (!vmbus_isnew_subchannel(primary, relid))
8f5e58
+			continue;	/* Already know about you */
8f5e58
+
8f5e58
+		if (!vmbus_uio_ring_present(dev, relid))
8f5e58
+			continue;	/* Ring may not be ready yet */
8f5e58
+
8f5e58
 		snprintf(subchan_path, sizeof(subchan_path), "%s/%lu",
8f5e58
 			 chan_path, relid);
8f5e58
 		err = vmbus_uio_sysfs_read(subchan_path, "subchannel_id",
8f5e58
@@ -370,12 +376,6 @@ int vmbus_uio_get_subchan(struct vmbus_channel *primary,
8f5e58
 		if (subid == 0)
8f5e58
 			continue;	/* skip primary channel */
8f5e58
 
8f5e58
-		if (!vmbus_isnew_subchannel(primary, relid))
8f5e58
-			continue;
8f5e58
-
8f5e58
-		if (!vmbus_uio_ring_present(dev, relid))
8f5e58
-			continue;	/* Ring may not be ready yet */
8f5e58
-
8f5e58
 		err = vmbus_uio_sysfs_read(subchan_path, "monitor_id",
8f5e58
 					   &monid, UINT8_MAX);
8f5e58
 		if (err) {
8f5e58
-- 
8f5e58
2.20.1
8f5e58