Update zfs_admin_snapshot value (disabled)

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
This commit is contained in:
George Melikov 2018-11-09 03:17:12 +03:00 committed by Brian Behlendorf
parent d8244d34bd
commit 877d925a9e
6 changed files with 30 additions and 14 deletions

View File

@ -29,6 +29,7 @@
* Brian Behlendorf <behlendorf1@llnl.gov> * Brian Behlendorf <behlendorf1@llnl.gov>
* Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2015, OmniTI Computer Consulting, Inc. 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) * Control Directory Tunables (.zfs)
*/ */
int zfs_expire_snapshot = ZFSCTL_EXPIRE_SNAPSHOT; int zfs_expire_snapshot = ZFSCTL_EXPIRE_SNAPSHOT;
int zfs_admin_snapshot = 1; int zfs_admin_snapshot = 0;
typedef struct { typedef struct {
char *se_name; /* full snapshot name */ char *se_name; /* full snapshot name */

View File

@ -27,6 +27,7 @@
# #
# Copyright (c) 2013, 2016 by Delphix. All rights reserved. # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
# Copyright (c) 2018 George Melikov. All Rights Reserved.
# #
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
@ -42,6 +43,8 @@ if ! is_linux; then
fi fi
fi fi
default_cleanup if is_linux; then
log_must set_tunable64 zfs_admin_snapshot 0
fi
log_pass default_cleanup

View File

@ -27,6 +27,7 @@
# #
# Copyright (c) 2013, 2016 by Delphix. All rights reserved. # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc. # Copyright 2016 Nexenta Systems, Inc.
# Copyright (c) 2018 George Melikov. All Rights Reserved.
# #
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib

View File

@ -27,6 +27,7 @@
# #
# Copyright (c) 2013, 2016 by Delphix. All rights reserved. # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
# Copyright (c) 2018 George Melikov. All Rights Reserved.
# #
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
@ -68,7 +69,9 @@ if [ $? -ne 0 ]; then
fi fi
DISK=${DISKS%% *} 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

View File

@ -31,4 +31,8 @@
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
if is_linux; then
log_must set_tunable64 zfs_admin_snapshot 0
fi
default_container_cleanup default_container_cleanup

View File

@ -33,4 +33,8 @@
DISK=${DISKS%% *} DISK=${DISKS%% *}
if is_linux; then
log_must set_tunable64 zfs_admin_snapshot 1
fi
default_container_volume_setup ${DISK} default_container_volume_setup ${DISK}