OpenZFS 6101 - attempt to lzc_create() a filesystem under a volume results in a panic

Authored by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

When querying ZPL properties verify that the objset is of type
DMU_OST_ZFS.

OpenZFS-issue: https://www.illumos.org/issues/6101
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ce2243a
Closes #6015
This commit is contained in:
Andriy Gapon 2017-04-13 14:32:08 -07:00 committed by Brian Behlendorf
parent 31b6bc74b9
commit 87a275d97a
2 changed files with 6 additions and 1 deletions

View File

@ -2998,6 +2998,9 @@ zfs_fill_zplprops_impl(objset_t *os, uint64_t zplver,
ASSERT(zplprops != NULL); ASSERT(zplprops != NULL);
if (os != NULL && os->os_phys->os_type != DMU_OST_ZFS)
return (SET_ERROR(EINVAL));
/* /*
* Pull out creator prop choices, if any. * Pull out creator prop choices, if any.
*/ */

View File

@ -2058,8 +2058,10 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value)
else else
pname = zfs_prop_to_name(prop); pname = zfs_prop_to_name(prop);
if (os != NULL) if (os != NULL) {
ASSERT3U(os->os_phys->os_type, ==, DMU_OST_ZFS);
error = zap_lookup(os, MASTER_NODE_OBJ, pname, 8, 1, value); error = zap_lookup(os, MASTER_NODE_OBJ, pname, 8, 1, value);
}
if (error == ENOENT) { if (error == ENOENT) {
/* No value set, use the default value */ /* No value set, use the default value */