aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_dataset.c
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-06-24 19:42:52 -0400
committerBrian Behlendorf <[email protected]>2019-06-24 16:42:52 -0700
commit53864800f60b843b8212514428530adfa155211b (patch)
tree9b249dfd150a2c26bed6c4cea6b7f085db0b308b /lib/libzfs/libzfs_dataset.c
parent8f12a4f8d2846ca668f8ad90d9ea5c19c8c0b78f (diff)
Fix error message on promoting encrypted dataset
This patch corrects the error message reported when attempting to promote a dataset outside of its encryption root. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #8905 Closes #8935
Diffstat (limited to 'lib/libzfs/libzfs_dataset.c')
-rw-r--r--lib/libzfs/libzfs_dataset.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 339132a97..1128275c0 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -4160,6 +4160,16 @@ zfs_promote(zfs_handle_t *zhp)
if (ret != 0) {
switch (ret) {
+ case EACCES:
+ /*
+ * Promoting encrypted dataset outside its
+ * encryption root.
+ */
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "cannot promote dataset outside its "
+ "encryption root"));
+ return (zfs_error(hdl, EZFS_EXISTS, errbuf));
+
case EEXIST:
/* There is a conflicting snapshot name. */
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,