summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/contrib/ast/src/cmd/ksh93/data/lexstates.c3
-rw-r--r--usr/src/contrib/ast/src/cmd/ksh93/include/lexstates.h1
-rw-r--r--usr/src/contrib/ast/src/cmd/ksh93/sh/lex.c28
-rw-r--r--usr/src/contrib/ast/src/cmd/ksh93/sh/parse.c2
-rw-r--r--usr/src/pkg/manifests/system-test-zfstest.mf3
-rw-r--r--usr/src/test/zfs-tests/runfiles/delphix.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/omnios.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/openindiana.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/smartos.run2
-rwxr-xr-xusr/src/test/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_clones.ksh80
-rw-r--r--usr/src/test/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_encryptionroot.ksh21
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_crypt.c70
-rw-r--r--usr/src/uts/common/io/ppp/sppptun/sppptun_impl.h2
13 files changed, 188 insertions, 30 deletions
diff --git a/usr/src/contrib/ast/src/cmd/ksh93/data/lexstates.c b/usr/src/contrib/ast/src/cmd/ksh93/data/lexstates.c
index d4a3628130..01e56f5471 100644
--- a/usr/src/contrib/ast/src/cmd/ksh93/data/lexstates.c
+++ b/usr/src/contrib/ast/src/cmd/ksh93/data/lexstates.c
@@ -393,13 +393,14 @@ const char e_lexsyntax2[] = "syntax error: `%s' %s";
const char e_lexsyntax3[] = "syntax error at line %d: duplicate label %s";
const char e_lexsyntax4[] = "syntax error at line %d: invalid reference list";
const char e_lexsyntax5[] = "syntax error at line %d: `<<%s' here-document not contained within command substitution";
-const char e_lexwarnvar[] = "line %d: variable expansion makes arithmetic evaluation less efficient";
+const char e_lexwarnvar[] = "line %d: in '((%s))', using '$' is unnecessary, incurs a penalty and can introduce rounding errors.";
const char e_lexlabignore[] = "line %d: label %s ignored";
const char e_lexlabunknown[] = "line %d: %s unknown label";
const char e_lexobsolete1[] = "line %d: `...` obsolete, use $(...)";
const char e_lexobsolete2[] = "line %d: -a obsolete, use -e";
const char e_lexobsolete3[] = "line %d: '=' obsolete, use '=='";
const char e_lexobsolete4[] = "line %d: %s within [[...]] obsolete, use ((...))";
+const char e_lexobsolete4b[] = "line %d: [[... %s ...]] obsolete, use ((... %s ...))";
const char e_lexobsolete5[] = "line %d: set %s obsolete";
const char e_lexobsolete6[] = "line %d: `{' instead of `in' is obsolete";
const char e_lexnonstandard[] = "line %d: `&>file' is nonstandard -- interpreted as `>file 2>&1' for profile input only";
diff --git a/usr/src/contrib/ast/src/cmd/ksh93/include/lexstates.h b/usr/src/contrib/ast/src/cmd/ksh93/include/lexstates.h
index a078e35ecf..ff2ae696c1 100644
--- a/usr/src/contrib/ast/src/cmd/ksh93/include/lexstates.h
+++ b/usr/src/contrib/ast/src/cmd/ksh93/include/lexstates.h
@@ -139,6 +139,7 @@ extern const char e_lexobsolete1[];
extern const char e_lexobsolete2[];
extern const char e_lexobsolete3[];
extern const char e_lexobsolete4[];
+extern const char e_lexobsolete4b[];
extern const char e_lexobsolete5[];
extern const char e_lexobsolete6[];
extern const char e_lexnonstandard[];
diff --git a/usr/src/contrib/ast/src/cmd/ksh93/sh/lex.c b/usr/src/contrib/ast/src/cmd/ksh93/sh/lex.c
index c42c10604e..b517246167 100644
--- a/usr/src/contrib/ast/src/cmd/ksh93/sh/lex.c
+++ b/usr/src/contrib/ast/src/cmd/ksh93/sh/lex.c
@@ -1462,8 +1462,36 @@ breakloop:
default:
if(lp->lex.testop2)
{
+#ifdef __ASTUpstream__
if(lp->lexd.warn && (c&TEST_ARITH))
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete4,shp->inlineno,state);
+#else
+ if(lp->lexd.warn && (c&TEST_ARITH)) {
+ char *alt = NULL;
+
+ if (strcmp(state, "-eq") == 0)
+ alt = "==";
+ else if (strcmp(state, "-ne") == 0)
+ alt = "!=";
+ else if (strcmp(state, "-lt") == 0)
+ alt = "<";
+ else if (strcmp(state, "-gt") == 0)
+ alt = ">";
+ else if (strcmp(state, "-le") == 0)
+ alt = "<=";
+ else if (strcmp(state, "-ge") == 0)
+ alt = ">=";
+ if (alt != NULL) {
+ errormsg(SH_DICT, ERROR_warn(0),
+ e_lexobsolete4b,
+ shp->inlineno, state, alt);
+ } else {
+ errormsg(SH_DICT, ERROR_warn(0),
+ e_lexobsolete4,
+ shp->inlineno, state);
+ }
+ }
+#endif
if(c&TEST_PATTERN)
lp->lex.incase = 1;
else if(c==TEST_REP)
diff --git a/usr/src/contrib/ast/src/cmd/ksh93/sh/parse.c b/usr/src/contrib/ast/src/cmd/ksh93/sh/parse.c
index 49289784ea..d9100840f0 100644
--- a/usr/src/contrib/ast/src/cmd/ksh93/sh/parse.c
+++ b/usr/src/contrib/ast/src/cmd/ksh93/sh/parse.c
@@ -290,7 +290,7 @@ static Shnode_t *getanode(Lex_t *lp, struct argnod *ap)
else
{
if(sh_isoption(SH_NOEXEC) && (ap->argflag&ARG_MAC) && paramsub(ap->argval))
- errormsg(SH_DICT,ERROR_warn(0),e_lexwarnvar,lp->sh->inlineno);
+ errormsg(SH_DICT,ERROR_warn(0),e_lexwarnvar,lp->sh->inlineno, ap->argval);
t->ar.arcomp = 0;
}
return(t);
diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf
index 4a8b5b8ba0..2280313dd8 100644
--- a/usr/src/pkg/manifests/system-test-zfstest.mf
+++ b/usr/src/pkg/manifests/system-test-zfstest.mf
@@ -739,6 +739,9 @@ file \
path=opt/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_child \
mode=0555
file \
+ path=opt/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_clones \
+ mode=0555
+file \
path=opt/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_format \
mode=0555
file \
diff --git a/usr/src/test/zfs-tests/runfiles/delphix.run b/usr/src/test/zfs-tests/runfiles/delphix.run
index 656e274985..0646d211fd 100644
--- a/usr/src/test/zfs-tests/runfiles/delphix.run
+++ b/usr/src/test/zfs-tests/runfiles/delphix.run
@@ -116,7 +116,7 @@ tests = ['zfs_001_neg', 'zfs_002_pos', 'zfs_003_neg']
[/opt/zfs-tests/tests/functional/cli_root/zfs_change-key]
tests = ['zfs_change-key', 'zfs_change-key_child', 'zfs_change-key_format',
'zfs_change-key_inherit', 'zfs_change-key_load', 'zfs_change-key_location',
- 'zfs_change-key_pbkdf2iters']
+ 'zfs_change-key_pbkdf2iters', 'zfs_change-key_clones']
[/opt/zfs-tests/tests/functional/cli_root/zfs_clone]
tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run
index 240155fa8d..c691593fba 100644
--- a/usr/src/test/zfs-tests/runfiles/omnios.run
+++ b/usr/src/test/zfs-tests/runfiles/omnios.run
@@ -118,7 +118,7 @@ tests = ['zfs_001_neg', 'zfs_002_pos', 'zfs_003_neg']
[/opt/zfs-tests/tests/functional/cli_root/zfs_change-key]
tests = ['zfs_change-key', 'zfs_change-key_child', 'zfs_change-key_format',
'zfs_change-key_inherit', 'zfs_change-key_load', 'zfs_change-key_location',
- 'zfs_change-key_pbkdf2iters']
+ 'zfs_change-key_pbkdf2iters', 'zfs_change-key_clones']
[/opt/zfs-tests/tests/functional/cli_root/zfs_clone]
tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run
index 4e3384a884..dfe5b337a4 100644
--- a/usr/src/test/zfs-tests/runfiles/openindiana.run
+++ b/usr/src/test/zfs-tests/runfiles/openindiana.run
@@ -118,7 +118,7 @@ tests = ['zfs_001_neg', 'zfs_002_pos', 'zfs_003_neg']
[/opt/zfs-tests/tests/functional/cli_root/zfs_change-key]
tests = ['zfs_change-key', 'zfs_change-key_child', 'zfs_change-key_format',
'zfs_change-key_inherit', 'zfs_change-key_load', 'zfs_change-key_location',
- 'zfs_change-key_pbkdf2iters']
+ 'zfs_change-key_pbkdf2iters', 'zfs_change-key_clones']
[/opt/zfs-tests/tests/functional/cli_root/zfs_clone]
tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/smartos.run b/usr/src/test/zfs-tests/runfiles/smartos.run
index 527403f93b..f3355c90c9 100644
--- a/usr/src/test/zfs-tests/runfiles/smartos.run
+++ b/usr/src/test/zfs-tests/runfiles/smartos.run
@@ -80,7 +80,7 @@ tests = ['zfs_001_neg', 'zfs_002_pos', 'zfs_003_neg']
[/opt/zfs-tests/tests/functional/cli_root/zfs_change-key]
tests = ['zfs_change-key', 'zfs_change-key_child', 'zfs_change-key_format',
'zfs_change-key_inherit', 'zfs_change-key_load', 'zfs_change-key_location',
- 'zfs_change-key_pbkdf2iters']
+ 'zfs_change-key_pbkdf2iters', 'zfs_change-key_clones']
[/opt/zfs-tests/tests/functional/cli_root/zfs_clone]
tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_clones.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_clones.ksh
new file mode 100755
index 0000000000..497fb99c81
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_change-key/zfs_change-key_clones.ksh
@@ -0,0 +1,80 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2017 Datto, Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
+
+#
+# DESCRIPTION:
+# 'zfs change-key' should correctly update encryption roots with clones.
+#
+# STRATEGY:
+# 1. Create an encrypted dataset
+# 2. Create an encryption root child of the first dataset
+# 3. Clone the child encryption root twice
+# 4. Add inheriting children to the encryption root and each of the clones
+# 5. Verify the encryption roots
+# 6. Have the child encryption root inherit from its parent
+# 7. Verify the encryption root for all datasets is now the parent dataset
+#
+
+verify_runnable "both"
+
+function cleanup
+{
+ datasetexists $TESTPOOL/$TESTFS1 && \
+ log_must zfs destroy -Rf $TESTPOOL/$TESTFS1
+}
+
+log_onexit cleanup
+
+log_assert "'zfs change-key' should correctly update encryption " \
+ "roots with clones"
+
+log_must eval "echo $PASSPHRASE1 | zfs create -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=prompt $TESTPOOL/$TESTFS1"
+log_must eval "echo $PASSPHRASE2 | zfs create -o encryption=on" \
+ "-o keyformat=passphrase -o keylocation=prompt $TESTPOOL/$TESTFS1/child"
+log_must zfs snapshot $TESTPOOL/$TESTFS1/child@1
+log_must zfs clone $TESTPOOL/$TESTFS1/child@1 $TESTPOOL/$TESTFS1/clone1
+log_must zfs clone $TESTPOOL/$TESTFS1/child@1 $TESTPOOL/$TESTFS1/clone2
+log_must zfs create $TESTPOOL/$TESTFS1/child/A
+log_must zfs create $TESTPOOL/$TESTFS1/clone1/B
+log_must zfs create $TESTPOOL/$TESTFS1/clone2/C
+
+log_must verify_encryption_root $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child $TESTPOOL/$TESTFS1/child
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone1 $TESTPOOL/$TESTFS1/child
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone2 $TESTPOOL/$TESTFS1/child
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child/A $TESTPOOL/$TESTFS1/child
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone1/B $TESTPOOL/$TESTFS1/child
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone2/C $TESTPOOL/$TESTFS1/child
+
+log_must zfs change-key -i $TESTPOOL/$TESTFS1/child
+
+log_must verify_encryption_root $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone1 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone2 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child/A $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone1/B $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/clone2/C $TESTPOOL/$TESTFS1
+
+log_pass "'zfs change-key' correctly updates encryption roots with clones"
diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_encryptionroot.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_encryptionroot.ksh
index 336c7b2538..2c7584d354 100644
--- a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_encryptionroot.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_promote/zfs_promote_encryptionroot.ksh
@@ -29,11 +29,12 @@
# 1. Create an encrypted dataset
# 2. Clone the encryption root
# 3. Clone the clone
-# 4. Verify the encryption root of all three datasets is the origin
+# 4. Add children to each of these three datasets
+# 4. Verify the encryption root of all datasets is the origin
# 5. Promote the clone of the clone
-# 6. Verify the encryption root of all three datasets is still the origin
-# 7. Promote the clone of the original encryption root
-# 8. Verify the encryption root of all three datasets is the promoted dataset
+# 6. Verify the encryption root of all datasets is still the origin
+# 7. Promote the dataset again, so it is now the encryption root
+# 8. Verify the encryption root of all datasets is the promoted dataset
#
verify_runnable "both"
@@ -62,19 +63,31 @@ log_must zfs snap $snaproot
log_must zfs clone $snaproot $TESTPOOL/clone1
log_must zfs snap $snapclone
log_must zfs clone $snapclone $TESTPOOL/clone2
+log_must zfs create $TESTPOOL/$TESTFS1/child0
+log_must zfs create $TESTPOOL/clone1/child1
+log_must zfs create $TESTPOOL/clone2/child2
log_must verify_encryption_root $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1
log_must verify_encryption_root $TESTPOOL/clone1 $TESTPOOL/$TESTFS1
log_must verify_encryption_root $TESTPOOL/clone2 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child0 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/clone1/child1 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/clone2/child2 $TESTPOOL/$TESTFS1
log_must zfs promote $TESTPOOL/clone2
log_must verify_encryption_root $TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS1
log_must verify_encryption_root $TESTPOOL/clone1 $TESTPOOL/$TESTFS1
log_must verify_encryption_root $TESTPOOL/clone2 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child0 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/clone1/child1 $TESTPOOL/$TESTFS1
+log_must verify_encryption_root $TESTPOOL/clone2/child2 $TESTPOOL/$TESTFS1
log_must zfs promote $TESTPOOL/clone2
log_must verify_encryption_root $TESTPOOL/$TESTFS1 $TESTPOOL/clone2
log_must verify_encryption_root $TESTPOOL/clone1 $TESTPOOL/clone2
log_must verify_encryption_root $TESTPOOL/clone2 $TESTPOOL/clone2
+log_must verify_encryption_root $TESTPOOL/$TESTFS1/child0 $TESTPOOL/clone2
+log_must verify_encryption_root $TESTPOOL/clone1/child1 $TESTPOOL/clone2
+log_must verify_encryption_root $TESTPOOL/clone2/child2 $TESTPOOL/clone2
log_pass "ZFS promotes clones of an encryption root"
diff --git a/usr/src/uts/common/fs/zfs/dsl_crypt.c b/usr/src/uts/common/fs/zfs/dsl_crypt.c
index a092326a9c..ed98740f1d 100644
--- a/usr/src/uts/common/fs/zfs/dsl_crypt.c
+++ b/usr/src/uts/common/fs/zfs/dsl_crypt.c
@@ -1391,10 +1391,17 @@ error:
return (ret);
}
-
+/*
+ * This function deals with the intricacies of updating wrapping
+ * key references and encryption roots recursively in the event
+ * of a call to 'zfs change-key' or 'zfs promote'. The 'skip'
+ * parameter should always be set to B_FALSE when called
+ * externally.
+ */
static void
spa_keystore_change_key_sync_impl(uint64_t rddobj, uint64_t ddobj,
- uint64_t new_rddobj, dsl_wrapping_key_t *wkey, dmu_tx_t *tx)
+ uint64_t new_rddobj, dsl_wrapping_key_t *wkey, boolean_t skip,
+ dmu_tx_t *tx)
{
int ret;
zap_cursor_t *zc;
@@ -1409,7 +1416,7 @@ spa_keystore_change_key_sync_impl(uint64_t rddobj, uint64_t ddobj,
/* hold the dd */
VERIFY0(dsl_dir_hold_obj(dp, ddobj, NULL, FTAG, &dd));
- /* ignore hidden dsl dirs */
+ /* ignore special dsl dirs */
if (dd->dd_myname[0] == '$' || dd->dd_myname[0] == '%') {
dsl_dir_rele(dd, FTAG);
return;
@@ -1422,7 +1429,8 @@ spa_keystore_change_key_sync_impl(uint64_t rddobj, uint64_t ddobj,
* Stop recursing if this dsl dir didn't inherit from the root
* or if this dd is a clone.
*/
- if (ret == ENOENT || curr_rddobj != rddobj || dsl_dir_is_clone(dd)) {
+ if (ret == ENOENT ||
+ (!skip && (curr_rddobj != rddobj || dsl_dir_is_clone(dd)))) {
dsl_dir_rele(dd, FTAG);
return;
}
@@ -1430,19 +1438,23 @@ spa_keystore_change_key_sync_impl(uint64_t rddobj, uint64_t ddobj,
/*
* If we don't have a wrapping key just update the dck to reflect the
* new encryption root. Otherwise rewrap the entire dck and re-sync it
- * to disk.
+ * to disk. If skip is set, we don't do any of this work.
*/
- if (wkey == NULL) {
- VERIFY0(zap_update(dp->dp_meta_objset, dd->dd_crypto_obj,
- DSL_CRYPTO_KEY_ROOT_DDOBJ, 8, 1, &new_rddobj, tx));
- } else {
- VERIFY0(spa_keystore_dsl_key_hold_dd(dp->dp_spa, dd,
- FTAG, &dck));
- dsl_wrapping_key_hold(wkey, dck);
- dsl_wrapping_key_rele(dck->dck_wkey, dck);
- dck->dck_wkey = wkey;
- dsl_crypto_key_sync(dck, tx);
- spa_keystore_dsl_key_rele(dp->dp_spa, dck, FTAG);
+ if (!skip) {
+ if (wkey == NULL) {
+ VERIFY0(zap_update(dp->dp_meta_objset,
+ dd->dd_crypto_obj,
+ DSL_CRYPTO_KEY_ROOT_DDOBJ, 8, 1,
+ &new_rddobj, tx));
+ } else {
+ VERIFY0(spa_keystore_dsl_key_hold_dd(dp->dp_spa, dd,
+ FTAG, &dck));
+ dsl_wrapping_key_hold(wkey, dck);
+ dsl_wrapping_key_rele(dck->dck_wkey, dck);
+ dck->dck_wkey = wkey;
+ dsl_crypto_key_sync(dck, tx);
+ spa_keystore_dsl_key_rele(dp->dp_spa, dck, FTAG);
+ }
}
zc = kmem_alloc(sizeof (zap_cursor_t), KM_SLEEP);
@@ -1454,7 +1466,27 @@ spa_keystore_change_key_sync_impl(uint64_t rddobj, uint64_t ddobj,
zap_cursor_retrieve(zc, za) == 0;
zap_cursor_advance(zc)) {
spa_keystore_change_key_sync_impl(rddobj,
- za->za_first_integer, new_rddobj, wkey, tx);
+ za->za_first_integer, new_rddobj, wkey, B_FALSE, tx);
+ }
+ zap_cursor_fini(zc);
+
+ /*
+ * Recurse into all dsl dirs of clones. We utilize the skip parameter
+ * here so that we don't attempt to process the clones directly. This
+ * is because the clone and its origin share the same dck, which has
+ * already been updated.
+ */
+ for (zap_cursor_init(zc, dp->dp_meta_objset,
+ dsl_dir_phys(dd)->dd_clones);
+ zap_cursor_retrieve(zc, za) == 0;
+ zap_cursor_advance(zc)) {
+ dsl_dataset_t *clone;
+
+ VERIFY0(dsl_dataset_hold_obj(dp, za->za_first_integer,
+ FTAG, &clone));
+ spa_keystore_change_key_sync_impl(rddobj,
+ clone->ds_dir->dd_object, new_rddobj, wkey, B_TRUE, tx);
+ dsl_dataset_rele(clone, FTAG);
}
zap_cursor_fini(zc);
@@ -1534,7 +1566,7 @@ spa_keystore_change_key_sync(void *arg, dmu_tx_t *tx)
/* recurse through all children and rewrap their keys */
spa_keystore_change_key_sync_impl(rddobj, ds->ds_dir->dd_object,
- new_rddobj, wkey, tx);
+ new_rddobj, wkey, B_FALSE, tx);
/*
* All references to the old wkey should be released now (if it
@@ -1708,7 +1740,7 @@ dsl_dataset_promote_crypt_sync(dsl_dir_t *target, dsl_dir_t *origin,
rw_enter(&dp->dp_spa->spa_keystore.sk_wkeys_lock, RW_WRITER);
spa_keystore_change_key_sync_impl(rddobj, origin->dd_object,
- target->dd_object, NULL, tx);
+ target->dd_object, NULL, B_FALSE, tx);
rw_exit(&dp->dp_spa->spa_keystore.sk_wkeys_lock);
dsl_dataset_rele(targetds, FTAG);
diff --git a/usr/src/uts/common/io/ppp/sppptun/sppptun_impl.h b/usr/src/uts/common/io/ppp/sppptun/sppptun_impl.h
index 58480ae60c..ab879959d8 100644
--- a/usr/src/uts/common/io/ppp/sppptun/sppptun_impl.h
+++ b/usr/src/uts/common/io/ppp/sppptun/sppptun_impl.h
@@ -150,7 +150,7 @@ struct tuncl_s {
};
#define TO_TLL(p) \
- ((tunll_t *)((caddr_t)(p) - offsetof(tunll_t, tll_next)))
+ ((tunll_t *)((uintptr_t)(p) - offsetof(tunll_t, tll_next)))
#define TLLF_NOTLOWER 0x00000001 /* never set */
#define TLLF_CLOSING 0x00000002 /* driver detach initiated */