[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480797282-10126-3-git-send-email-kys@exchange.microsoft.com>
Date: Sat, 3 Dec 2016 12:34:30 -0800
From: kys@...hange.microsoft.com
To: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
devel@...uxdriverproject.org, olaf@...fle.de, apw@...onical.com,
vkuznets@...hat.com, jasowang@...hat.com,
leann.ogasawara@...onical.com
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Subject: [PATCH V2 03/15] Drivers: hv: vmbus: Prevent sending data on a rescinded channel
From: K. Y. Srinivasan <kys@...rosoft.com>
After the channel is rescinded, the host does not read from the rescinded channel.
Fail writes to a channel that has already been rescinded.
Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
---
drivers/hv/ring_buffer.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index cd49cb1..72f649d 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -298,6 +298,9 @@ int hv_ringbuffer_write(struct vmbus_channel *channel,
unsigned long flags = 0;
struct hv_ring_buffer_info *outring_info = &channel->outbound;
+ if (channel->rescind)
+ return -ENODEV;
+
for (i = 0; i < kv_count; i++)
totalbytes_towrite += kv_list[i].iov_len;
--
1.7.4.1
Powered by blists - more mailing lists