Plug open count leak on zvol rename.

MFC after:	2 weeks
This commit is contained in:
mav 2016-03-30 16:54:18 +00:00
parent b85bec3458
commit 06c88b0e22

View File

@ -2977,6 +2977,11 @@ zvol_rename_minor(zvol_state_t *zv, const char *newname)
ASSERT(dev != NULL);
zv->zv_dev = NULL;
destroy_dev(dev);
if (zv->zv_total_opens > 0) {
zv->zv_flags &= ~ZVOL_EXCL;
zv->zv_total_opens = 0;
zvol_last_close(zv);
}
make_dev_args_init(&args);
args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK;