]> granicus.if.org Git - zfs/commitdiff
Update zfs_admin_snapshot value (disabled)
authorGeorge Melikov <mail@gmelikov.ru>
Fri, 9 Nov 2018 00:17:12 +0000 (03:17 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 9 Nov 2018 00:17:12 +0000 (16:17 -0800)
It's disabled by default, update code and tests to reflect
the documentation.

Minor cleanup in delegate_common.kshlib.

Reviewed-by: Gregor Kopka <gregor@kopka.net>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #7835
Closes #8045

module/zfs/zfs_ctldir.c
tests/zfs-tests/tests/functional/delegate/cleanup.ksh
tests/zfs-tests/tests/functional/delegate/delegate_common.kshlib
tests/zfs-tests/tests/functional/delegate/setup.ksh
tests/zfs-tests/tests/functional/snapshot/cleanup.ksh
tests/zfs-tests/tests/functional/snapshot/setup.ksh

index 35a86d43410d3557d71ede258ca570bf7d4a3f3f..485f21b79e0276eb88556f1c4c60062639518ef6 100644 (file)
@@ -29,6 +29,7 @@
  *   Brian Behlendorf <behlendorf1@llnl.gov>
  * 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 */
index c3451cd78d0c83da183c495a7ecc60bc507396c0..31a57590fcb00e5446c35400f9415fac4b5c5ed8 100755 (executable)
@@ -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
index 6de1120f32ce7aed741a85290a41398295cd2c8a..d088eaf371a42aac05e93844f95dcf3648a28deb 100644 (file)
@@ -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
 
index 07d615d3955f9885709338eb3e5e1d3b269aaf56..149cf7869ae79de8d95c92109d3b7b55478a66e8 100755 (executable)
@@ -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
index c4c369145dfc54b0cdc9c9b1b60173c281875537..12d950999cae6f0094b8c0d50d0bbf7f0a692071 100755 (executable)
@@ -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
index d8733f3c0ff043c805e481c702298c04556d22ba..6f0646737ecade8ac05f092dde0d21ae699914de 100755 (executable)
@@ -33,4 +33,8 @@
 
 DISK=${DISKS%% *}
 
+if is_linux; then
+       log_must set_tunable64 zfs_admin_snapshot 1
+fi
+
 default_container_volume_setup ${DISK}