From 681d9761e8516a7dc5ab6589e2dfe717777e1123 Mon Sep 17 00:00:00 2001 From: Eric Taylor Date: Mon, 21 Sep 2009 08:55:28 -0600 Subject: 6438937 if 'zfs destroy' fails, it can leave a zvol device link missing 6573142 zpool destruction/export should better handle stale zvol links 6718816 ZFS volinit fails when ZFS root pool full 6761786 zpool import with 8500 snapshots took 11hours 6604403 replace volinit/volfini with /dev fs vnode ops 6847760 zfs volinit may happen a little too soon during boot 6488792 Warnings on console whenever a volume is created. 6738837 assertion failure in sdev_open 6878496 dmu_objset_own returns EINVAL instead of EROFS in some situations --- usr/src/uts/common/fs/zfs/vdev.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'usr/src/uts/common/fs/zfs/vdev.c') diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index bb5024f985..415cd4a9e9 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -1007,12 +1007,35 @@ vdev_open_child(void *arg) vd->vdev_open_thread = NULL; } +boolean_t +vdev_uses_zvols(vdev_t *vd) +{ + if (vd->vdev_path && strncmp(vd->vdev_path, ZVOL_DIR, + strlen(ZVOL_DIR)) == 0) + return (B_TRUE); + for (int c = 0; c < vd->vdev_children; c++) + if (vdev_uses_zvols(vd->vdev_child[c])) + return (B_TRUE); + return (B_FALSE); +} + void vdev_open_children(vdev_t *vd) { taskq_t *tq; int children = vd->vdev_children; + /* + * in order to handle pools on top of zvols, do the opens + * in a single thread so that the same thread holds the + * spa_namespace_lock + */ + if (vdev_uses_zvols(vd)) { + for (int c = 0; c < children; c++) + vd->vdev_child[c]->vdev_open_error = + vdev_open(vd->vdev_child[c]); + return; + } tq = taskq_create("vdev_open", children, minclsyspri, children, children, TASKQ_PREPOPULATE); -- cgit v1.2.3