Date: Tue, 8 Nov 2016 20:58:25 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308448 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201611082058.uA8KwPMS096089@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Nov 8 20:58:25 2016 New Revision: 308448 URL: https://svnweb.freebsd.org/changeset/base/308448 Log: MFC r307857: Fix panic after ZVOL renamed to name invalid for DEVFS. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 8 20:57:46 2016 (r308447) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 8 20:58:25 2016 (r308448) @@ -780,8 +780,10 @@ zvol_remove_zv(zvol_state_t *zv) g_topology_lock(); zvol_geom_destroy(zv); g_topology_unlock(); - } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) - destroy_dev(zv->zv_dev); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + if (zv->zv_dev != NULL) + destroy_dev(zv->zv_dev); + } #endif avl_destroy(&zv->zv_znode.z_range_avl); @@ -2952,14 +2954,14 @@ zvol_rename_minor(zvol_state_t *zv, cons } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { struct make_dev_args args; - dev = zv->zv_dev; - 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); + if ((dev = zv->zv_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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611082058.uA8KwPMS096089>