From 2d5843db7439a2f07385993dc762c76159967f5a Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Thu, 5 Nov 2009 15:39:49 -0800 Subject: [PATCH] 6893929 User/group quotas passed to "zfs create" are not properly set --- usr/src/lib/libzfs/common/libzfs_dataset.c | 9 +++++++-- usr/src/uts/common/fs/zfs/zfs_ioctl.c | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c index df5bf7a3a2..13acb5bc68 100644 --- a/usr/src/lib/libzfs/common/libzfs_dataset.c +++ b/usr/src/lib/libzfs/common/libzfs_dataset.c @@ -815,9 +815,14 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, goto error; } + /* + * Encode the prop name as + * userquota@-domain, to make it easy + * for the kernel to decode. + */ (void) snprintf(newpropname, sizeof (newpropname), - "%s%s", zfs_userquota_prop_prefixes[uqtype], - domain); + "%s%llx-%s", zfs_userquota_prop_prefixes[uqtype], + (longlong_t)rid, domain); valary[0] = uqtype; valary[1] = rid; valary[2] = intval; diff --git a/usr/src/uts/common/fs/zfs/zfs_ioctl.c b/usr/src/uts/common/fs/zfs/zfs_ioctl.c index 070677acdf..1c3875f4ba 100644 --- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c +++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c @@ -1729,8 +1729,11 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl) type = valary[0]; rid = valary[1]; quota = valary[2]; - domain = propname + - strlen(zfs_userquota_prop_prefixes[type]); + /* + * The propname is encoded as + * userquota@-. + */ + domain = strchr(propname, '-') + 1; error = zfsvfs_hold(name, FTAG, &zfsvfs); if (error == 0) { -- 2.11.4.GIT