FreeBSD Bugzilla – Attachment 170229 Details for
Bug 209428
if_vtnet(4) panics when doing kldunload if_vtnet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch v4
virtio-net-unload4.diff (text/plain), 1.08 KB, created by
Roman Bogorodskiy
on 2016-05-12 14:47:38 UTC
(
hide
)
Description:
patch v4
Filename:
MIME Type:
Creator:
Roman Bogorodskiy
Created:
2016-05-12 14:47:38 UTC
Size:
1.08 KB
patch
obsolete
>Index: if_vtnet.c >=================================================================== >--- if_vtnet.c (revision 299234) >+++ if_vtnet.c (working copy) >@@ -311,23 +311,25 @@ > static int > vtnet_modevent(module_t mod, int type, void *unused) > { >- int error; >+ int error = 0; >+ static int loaded = 0; > >- error = 0; >- > switch (type) { > case MOD_LOAD: >- vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", >- sizeof(struct vtnet_tx_header), >- NULL, NULL, NULL, NULL, 0, 0); >+ if (loaded++ == 0) >+ vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", >+ sizeof(struct vtnet_tx_header), >+ NULL, NULL, NULL, NULL, 0, 0); > break; > case MOD_QUIESCE: > case MOD_UNLOAD: >- if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) >- error = EBUSY; >- else if (type == MOD_UNLOAD) { >- uma_zdestroy(vtnet_tx_header_zone); >- vtnet_tx_header_zone = NULL; >+ if (--loaded == 0) { >+ if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) >+ error = EBUSY; >+ else if (type == MOD_UNLOAD) { >+ uma_zdestroy(vtnet_tx_header_zone); >+ vtnet_tx_header_zone = NULL; >+ } > } > break; > case MOD_SHUTDOWN:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209428
:
170182
|
170217
|
170227
|
170229
|
170230