Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144816364
D8566.id22493.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8566.id22493.diff
View Options
Index: head/sys/dev/hyperv/vmbus/vmbus_chan.c
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c
@@ -688,10 +688,28 @@
struct vmbus_softc *sc = chan->ch_vmbus;
struct vmbus_msghc *mh;
struct vmbus_chanmsg_chclose *req;
+ uint32_t old_stflags;
int error;
- /* TODO: stringent check */
- atomic_clear_int(&chan->ch_stflags, VMBUS_CHAN_ST_OPENED);
+ /*
+ * NOTE:
+ * Sub-channels are closed upon their primary channel closing,
+ * so they can be closed even before they are opened.
+ */
+ for (;;) {
+ old_stflags = chan->ch_stflags;
+ if (atomic_cmpset_int(&chan->ch_stflags, old_stflags,
+ old_stflags & ~VMBUS_CHAN_ST_OPENED))
+ break;
+ }
+ if ((old_stflags & VMBUS_CHAN_ST_OPENED) == 0) {
+ /* Not opened yet; done */
+ if (bootverbose) {
+ vmbus_chan_printf(chan, "chan%u not opened\n",
+ chan->ch_id);
+ }
+ return;
+ }
/*
* Free this channel's sysctl tree attached to its device's
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 14, 12:34 AM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28683373
Default Alt Text
D8566.id22493.diff (1 KB)
Attached To
Mode
D8566: hyperv/vmbus: Don't close unopened channels.
Attached
Detach File
Event Timeline
Log In to Comment