diff options
author | mav <mav@FreeBSD.org> | 2016-04-04 09:50:28 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-04-04 09:50:28 +0000 |
commit | 281ccdd8d1fcae3f13ee7cdc0d066fc10244c029 (patch) | |
tree | e23183be20ad5673a84fef90b53e1169c5d6e63c /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c | |
parent | 2bf9d9f9112abee39df3ec7690c3774fe5c22965 (diff) | |
download | FreeBSD-src-281ccdd8d1fcae3f13ee7cdc0d066fc10244c029.zip FreeBSD-src-281ccdd8d1fcae3f13ee7cdc0d066fc10244c029.tar.gz |
MFC r297421: Plug open count leak on zvol rename.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c index b9bf457..77d951e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c @@ -2964,6 +2964,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; |