Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2016 07:41:42 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309136 - head/sys/dev/hyperv/vmbus
Message-ID:  <201611250741.uAP7fgMu092389@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Fri Nov 25 07:41:42 2016
New Revision: 309136
URL: https://svnweb.freebsd.org/changeset/base/309136

Log:
  hyperv/vmbus: Don't free the bufring if its GPADL can't be disconnected.
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8570

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_chan.c

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c	Fri Nov 25 07:24:11 2016	(r309135)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c	Fri Nov 25 07:41:42 2016	(r309136)
@@ -814,8 +814,22 @@ vmbus_chan_close_internal(struct vmbus_c
 	/*
 	 * Disconnect the TX+RX bufrings from this channel.
 	 */
-	if (chan->ch_bufring_gpadl) {
-		vmbus_chan_gpadl_disconnect(chan, chan->ch_bufring_gpadl);
+	if (chan->ch_bufring_gpadl != 0) {
+		int error1;
+
+		error1 = vmbus_chan_gpadl_disconnect(chan,
+		    chan->ch_bufring_gpadl);
+		if (error1) {
+			/*
+			 * XXX
+			 * The bufring GPADL is still connected; abandon
+			 * this bufring, instead of having mysterious
+			 * crash or trashed data later on.
+			 */
+			vmbus_chan_printf(chan, "chan%u bufring GPADL "
+			    "is still connected after close\n", chan->ch_id);
+			chan->ch_bufring = NULL;
+		}
 		chan->ch_bufring_gpadl = 0;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611250741.uAP7fgMu092389>