Print this page
NEX-7233 Attempting to destroy ZFS filesystem and create ZFS volume with the same name caused system panic
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
@@ -2169,10 +2169,14 @@
ASSERT(RW_READ_HELD(&ddv->sdev_contents));
if (rw_tryupgrade(&ddv->sdev_contents) == 0) {
rw_exit(&ddv->sdev_contents);
rw_enter(&ddv->sdev_contents, RW_WRITER);
}
+
+ if (SDEVTOV(dv)->v_type == VDIR)
+ (void) sdev_cleandir(dv, NULL, SDEV_ENFORCE);
+
sdev_cache_update(ddv, &dv, nm, SDEV_CACHE_DELETE);
rw_downgrade(&ddv->sdev_contents);
SDEV_RELE(dv);
dv = NULL;
goto lookup_create_node;