summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-11-05 16:29:03 +0000
committerpjd <pjd@FreeBSD.org>2011-11-05 16:29:03 +0000
commit926e106e807e180f532ed962b0b90d19e1f54daa (patch)
tree912031c4f172c399205a876d23db45780543b2c1 /sys/cddl
parente58889997a9c87f0bc355cd1255f44210d975dde (diff)
downloadFreeBSD-src-926e106e807e180f532ed962b0b90d19e1f54daa.zip
FreeBSD-src-926e106e807e180f532ed962b0b90d19e1f54daa.tar.gz
In zvol_open() if the spa_namespace_lock is already held, it means that
ZFS is trying to open and taste ZVOL as its VDEV. This is not supported, so return an error instead of panicing on spa_namespace_lock recursion. Reported by: Robert Millan <rmh@debian.org> PR: kern/162008 MFC after: 3 days
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c8
1 files changed, 8 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 a14a9fe..6eec455 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -875,6 +875,14 @@ zvol_open(struct g_provider *pp, int flag, int count)
zvol_state_t *zv;
int err = 0;
+ if (MUTEX_HELD(&spa_namespace_lock)) {
+ /*
+ * If the spa_namespace_lock is being held, it means that ZFS
+ * is trying to open ZVOL as its VDEV. This i not supported.
+ */
+ return (EOPNOTSUPP);
+ }
+
mutex_enter(&spa_namespace_lock);
zv = pp->private;
OpenPOWER on IntegriCloud