'ZFS_ERR_STREAM_LARGE_BLOCK_MISMATCH',
'ZFS_ERR_RESILVER_IN_PROGRESS',
'ZFS_ERR_REBUILD_IN_PROGRESS',
+ 'ZFS_ERR_BADPROP',
],
{}
)
ZFS_ERR_VDEV_TOO_BIG = zfs_errno.ZFS_ERR_VDEV_TOO_BIG
ZFS_ERR_WRONG_PARENT = zfs_errno.ZFS_ERR_WRONG_PARENT
-
# vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4
raise lzc_exc.ParentNotFound(name)
if ret == ZFS_ERR_WRONG_PARENT:
raise lzc_exc.WrongParent(_fs_name(name))
+ if ret == zfs_errno.ZFS_ERR_BADPROP:
+ raise lzc_exc.PropertyInvalid(name)
raise _generic_exception(ret, name, "Failed to create filesystem")
def _map(ret, name):
if ret == errno.EINVAL:
return lzc_exc.PropertyInvalid(name)
+ if ret == zfs_errno.ZFS_ERR_BADPROP:
+ return lzc_exc.PropertyInvalid(name)
return _generic_exception(ret, name, "Failed to set property")
_handle_err_list(
errno.EINVAL, properrs, [snapname],
raise lzc_exc.WrongParent(_fs_name(snapname))
if ret == zfs_errno.ZFS_ERR_STREAM_TRUNCATED:
raise lzc_exc.StreamTruncated()
+ if ret == zfs_errno.ZFS_ERR_BADPROP:
+ raise lzc_exc.PropertyInvalid(snapname)
raise lzc_exc.StreamIOError(ret)
ZFS_ERR_STREAM_LARGE_BLOCK_MISMATCH,
ZFS_ERR_RESILVER_IN_PROGRESS,
ZFS_ERR_REBUILD_IN_PROGRESS,
+ ZFS_ERR_BADPROP,
} zfs_errno_t;
/*
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
* Copyright (c) 2017 Datto Inc.
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by Allan Jude
+ * under sponsorship from the FreeBSD Foundation.
*/
/*
case ZFS_ERR_WRONG_PARENT:
zfs_verror(hdl, EZFS_WRONG_PARENT, fmt, ap);
break;
+ case ZFS_ERR_BADPROP:
+ zfs_verror(hdl, EZFS_BADPROP, fmt, ap);
+ break;
default:
zfs_error_aux(hdl, strerror(error));
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
}
break;
+ case ZFS_ERR_BADPROP:
+ (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
+ break;
+
case EACCES:
if (prop == ZFS_PROP_KEYLOCATION) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
case ZFS_ERR_REBUILD_IN_PROGRESS:
zfs_verror(hdl, EZFS_REBUILDING, fmt, ap);
break;
+ case ZFS_ERR_BADPROP:
+ zfs_verror(hdl, EZFS_BADPROP, fmt, ap);
+ break;
case ZFS_ERR_IOC_CMD_UNAVAIL:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "the loaded zfs "
"module does not support this operation. A reboot may "
case PROP_TYPE_INDEX:
if (zfs_prop_index_to_string(prop,
intval, &unused) != 0)
- err = SET_ERROR(EINVAL);
+ err =
+ SET_ERROR(ZFS_ERR_BADPROP);
break;
default:
cmn_err(CE_PANIC,