aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/zfs/zfs_ctldir.c3
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/cleanup.ksh7
-rw-r--r--tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib17
-rwxr-xr-xtests/zfs-tests/tests/functional/delegate/setup.ksh9
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/cleanup.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/snapshot/setup.ksh4
6 files changed, 30 insertions, 14 deletions
diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
index 35a86d434..485f21b79 100644
--- a/module/zfs/zfs_ctldir.c
+++ b/module/zfs/zfs_ctldir.c
@@ -29,6 +29,7 @@
* Brian Behlendorf <[email protected]>
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+ * Copyright (c) 2018 George Melikov. All Rights Reserved.
*/
/*
@@ -106,7 +107,7 @@ static krwlock_t zfs_snapshot_lock;
* Control Directory Tunables (.zfs)
*/
int zfs_expire_snapshot = ZFSCTL_EXPIRE_SNAPSHOT;
-int zfs_admin_snapshot = 1;
+int zfs_admin_snapshot = 0;
typedef struct {
char *se_name; /* full snapshot name */
diff --git a/tests/zfs-tests/tests/functional/delegate/cleanup.ksh b/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
index c3451cd78..31a57590f 100755
--- a/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/cleanup.ksh
@@ -27,6 +27,7 @@
#
# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2018 George Melikov. All Rights Reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -42,6 +43,8 @@ if ! is_linux; then
fi
fi
-default_cleanup
+if is_linux; then
+ log_must set_tunable64 zfs_admin_snapshot 0
+fi
-log_pass
+default_cleanup
diff --git a/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib b/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
index 6de1120f3..d088eaf37 100644
--- a/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
+++ b/tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
@@ -27,6 +27,7 @@
#
# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc.
+# Copyright (c) 2018 George Melikov. All Rights Reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -766,7 +767,7 @@ function verify_fs_clone
typeset fs=$3
typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
- typeset basefs=${fs%/*}
+ typeset basefs=${fs%/*}
typeset snap=$fs@snap.$stamp
typeset clone=$basefs/cfs.$stamp
@@ -811,7 +812,7 @@ function verify_fs_rename
typeset fs=$3
typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
- typeset basefs=${fs%/*}
+ typeset basefs=${fs%/*}
typeset snap=$fs@snap.$stamp
typeset renamefs=$basefs/nfs.$stamp
@@ -1001,7 +1002,7 @@ function verify_fs_promote
typeset fs=$3
typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
- typeset basefs=${fs%/*}
+ typeset basefs=${fs%/*}
typeset snap=$fs@snap.$stamp
typeset clone=$basefs/cfs.$stamp
@@ -1368,7 +1369,7 @@ function verify_vol_snapshot
typeset vol=$3
typeset stamp=${perm}.${user}.$(date +'%F-%T-%N')
- typeset basevol=${vol%/*}
+ typeset basevol=${vol%/*}
typeset snap=$vol@snap.$stamp
user_run $user zfs snapshot $snap
@@ -1393,7 +1394,7 @@ function verify_vol_rollback
typeset vol=$3
typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
- typeset basevol=${vol%/*}
+ typeset basevol=${vol%/*}
typeset snap=$vol@snap.$stamp
typeset oldval
@@ -1428,7 +1429,7 @@ function verify_vol_clone
typeset vol=$3
typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
- typeset basevol=${vol%/*}
+ typeset basevol=${vol%/*}
typeset snap=$vol@snap.$stamp
typeset clone=$basevol/cvol.$stamp
@@ -1474,7 +1475,7 @@ function verify_vol_rename
typeset vol=$3
typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
- typeset basevol=${vol%/*}
+ typeset basevol=${vol%/*}
typeset snap=$vol@snap.$stamp
typeset clone=$basevol/cvol.$stamp
typeset renamevol=$basevol/nvol.$stamp
@@ -1521,7 +1522,7 @@ function verify_vol_promote
typeset vol=$3
typeset stamp=${perm}.${user}.$(date+'%F-%T-%N')
- typeset basevol=${vol%/*}
+ typeset basevol=${vol%/*}
typeset snap=$vol@snap.$stamp
typeset clone=$basevol/cvol.$stamp
diff --git a/tests/zfs-tests/tests/functional/delegate/setup.ksh b/tests/zfs-tests/tests/functional/delegate/setup.ksh
index 07d615d39..149cf7869 100755
--- a/tests/zfs-tests/tests/functional/delegate/setup.ksh
+++ b/tests/zfs-tests/tests/functional/delegate/setup.ksh
@@ -27,6 +27,7 @@
#
# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+# Copyright (c) 2018 George Melikov. All Rights Reserved.
#
. $STF_SUITE/include/libtest.shlib
@@ -68,7 +69,9 @@ if [ $? -ne 0 ]; then
fi
DISK=${DISKS%% *}
-default_volume_setup $DISK
-log_must chmod 777 $TESTDIR
-log_pass
+if is_linux; then
+ log_must set_tunable64 zfs_admin_snapshot 1
+fi
+
+default_volume_setup $DISK
diff --git a/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh b/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
index c4c369145..12d950999 100755
--- a/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
@@ -31,4 +31,8 @@
. $STF_SUITE/include/libtest.shlib
+if is_linux; then
+ log_must set_tunable64 zfs_admin_snapshot 0
+fi
+
default_container_cleanup
diff --git a/tests/zfs-tests/tests/functional/snapshot/setup.ksh b/tests/zfs-tests/tests/functional/snapshot/setup.ksh
index d8733f3c0..6f0646737 100755
--- a/tests/zfs-tests/tests/functional/snapshot/setup.ksh
+++ b/tests/zfs-tests/tests/functional/snapshot/setup.ksh
@@ -33,4 +33,8 @@
DISK=${DISKS%% *}
+if is_linux; then
+ log_must set_tunable64 zfs_admin_snapshot 1
+fi
+
default_container_volume_setup ${DISK}