mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Compare commits
39 Commits
zfs-2.1.15
...
zfs-0.8.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 63b88f7e22 | |||
| 72888812b0 | |||
| 581c77e725 | |||
| ba505f90d8 | |||
| eaa21b2349 | |||
| 8dc8bbde6e | |||
| 9fd95a2f1b | |||
| 35050ef39e | |||
| 5108d27aec | |||
| 02010e9c2c | |||
| a0bf24952d | |||
| d6920fb996 | |||
| 58b2de6420 | |||
| 11ad06d1d8 | |||
| 4f8eef29e0 | |||
| 94866d8309 | |||
| a1eaf0dde0 | |||
| 580256045b | |||
| aaf3b30dcf | |||
| 27b446f799 | |||
| 0c6206e7f1 | |||
| 51de7ccb42 | |||
| 69ae34076f | |||
| b746c397e3 | |||
| 2fb37bcadd | |||
| a727f69e52 | |||
| 8ec352be1f | |||
| df717bb835 | |||
| e0b3689ed5 | |||
| 438275c9a0 | |||
| 8cfa6d4a1c | |||
| ad0157ec91 | |||
| cd75d5f710 | |||
| c6bbacebc8 | |||
| 4d7cb872e8 | |||
| f91e7e6284 | |||
| abe267f677 | |||
| cc434dcf45 | |||
| e2e7b0a2cd |
@@ -1,7 +1,7 @@
|
||||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 0.8.0
|
||||
Version: 0.8.1
|
||||
Release: 1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
|
||||
+2
-1
@@ -111,9 +111,10 @@ mancheck:
|
||||
fi
|
||||
|
||||
testscheck:
|
||||
@find ${top_srcdir}/tests/zfs-tests/tests -type f \
|
||||
@find ${top_srcdir}/tests/zfs-tests -type f \
|
||||
\( -name '*.ksh' -not -executable \) -o \
|
||||
\( -name '*.kshlib' -executable \) -o \
|
||||
\( -name '*.shlib' -executable \) -o \
|
||||
\( -name '*.cfg' -executable \) | \
|
||||
xargs -r stat -c '%A %n' | \
|
||||
awk '{c++; print} END {if(c>0) exit 1}'
|
||||
|
||||
+7
-2
@@ -1,3 +1,8 @@
|
||||
SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest
|
||||
SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed
|
||||
SUBDIRS += arc_summary raidz_test zgenhostid
|
||||
SUBDIRS += fsck_zfs vdev_id raidz_test zgenhostid
|
||||
|
||||
if USING_PYTHON
|
||||
SUBDIRS += arcstat arc_summary dbufstat
|
||||
endif
|
||||
|
||||
SUBDIRS += mount_zfs zed zvol_id
|
||||
|
||||
@@ -4,9 +4,7 @@ if USING_PYTHON_2
|
||||
dist_bin_SCRIPTS = arc_summary2
|
||||
install-exec-hook:
|
||||
mv $(DESTDIR)$(bindir)/arc_summary2 $(DESTDIR)$(bindir)/arc_summary
|
||||
endif
|
||||
|
||||
if USING_PYTHON_3
|
||||
else
|
||||
dist_bin_SCRIPTS = arc_summary3
|
||||
install-exec-hook:
|
||||
mv $(DESTDIR)$(bindir)/arc_summary3 $(DESTDIR)$(bindir)/arc_summary
|
||||
|
||||
+9
-5
@@ -28,6 +28,7 @@
|
||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
||||
* Copyright 2016 Nexenta Systems, Inc.
|
||||
* Copyright (c) 2019 Datto Inc.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@@ -2238,7 +2239,7 @@ zfs_do_upgrade(int argc, char **argv)
|
||||
boolean_t showversions = B_FALSE;
|
||||
int ret = 0;
|
||||
upgrade_cbdata_t cb = { 0 };
|
||||
signed char c;
|
||||
int c;
|
||||
int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
|
||||
|
||||
/* check options */
|
||||
@@ -3932,7 +3933,7 @@ static int
|
||||
zfs_do_snapshot(int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
signed char c;
|
||||
int c;
|
||||
nvlist_t *props;
|
||||
snap_cbdata_t sd = { 0 };
|
||||
boolean_t multiple_snaps = B_FALSE;
|
||||
@@ -6621,10 +6622,13 @@ share_mount(int op, int argc, char **argv)
|
||||
|
||||
/*
|
||||
* libshare isn't mt-safe, so only do the operation in parallel
|
||||
* if we're mounting.
|
||||
* if we're mounting. Additionally, the key-loading option must
|
||||
* be serialized so that we can prompt the user for their keys
|
||||
* in a consistent manner.
|
||||
*/
|
||||
zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used,
|
||||
share_mount_one_cb, &share_mount_state, op == OP_MOUNT);
|
||||
share_mount_one_cb, &share_mount_state,
|
||||
op == OP_MOUNT && !(flags & MS_CRYPT));
|
||||
ret = share_mount_state.sm_status;
|
||||
|
||||
for (int i = 0; i < cb.cb_used; i++)
|
||||
@@ -7522,7 +7526,7 @@ zfs_do_channel_program(int argc, char **argv)
|
||||
}
|
||||
|
||||
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
|
||||
(void) fprintf(stderr, gettext("cannot open pool '%s'"),
|
||||
(void) fprintf(stderr, gettext("cannot open pool '%s'\n"),
|
||||
poolname);
|
||||
if (fd != 0)
|
||||
(void) close(fd);
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
* Copyright (c) 2017 Datto Inc.
|
||||
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2017, Intel Corporation.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@@ -384,11 +385,11 @@ get_usage(zpool_help_t idx)
|
||||
case HELP_RESILVER:
|
||||
return (gettext("\tresilver <pool> ...\n"));
|
||||
case HELP_TRIM:
|
||||
return (gettext("\ttrim [-dp] [-r <rate>] [-c | -s] <pool> "
|
||||
return (gettext("\ttrim [-d] [-r <rate>] [-c | -s] <pool> "
|
||||
"[<device> ...]\n"));
|
||||
case HELP_STATUS:
|
||||
return (gettext("\tstatus [-c [script1,script2,...]] "
|
||||
"[-igLpPsvxD] [-T d|u] [pool] ... \n"
|
||||
"[-igLpPstvxD] [-T d|u] [pool] ... \n"
|
||||
"\t [interval [count]]\n"));
|
||||
case HELP_UPGRADE:
|
||||
return (gettext("\tupgrade\n"
|
||||
@@ -972,7 +973,7 @@ zpool_do_remove(int argc, char **argv)
|
||||
int i, ret = 0;
|
||||
zpool_handle_t *zhp = NULL;
|
||||
boolean_t stop = B_FALSE;
|
||||
char c;
|
||||
int c;
|
||||
boolean_t noop = B_FALSE;
|
||||
boolean_t parsable = B_FALSE;
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ main(int argc, char *argv[])
|
||||
struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
|
||||
struct drr_object_range *drror = &thedrr.drr_u.drr_object_range;
|
||||
struct drr_checksum *drrc = &thedrr.drr_u.drr_checksum;
|
||||
char c;
|
||||
int c;
|
||||
boolean_t verbose = B_FALSE;
|
||||
boolean_t very_verbose = B_FALSE;
|
||||
boolean_t first = B_TRUE;
|
||||
|
||||
+24
-19
@@ -12,6 +12,17 @@ AC_DEFUN([ZFS_AC_PYTHON_VERSION], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # ZFS_AC_PYTHON_VERSION_IS_2
|
||||
dnl # ZFS_AC_PYTHON_VERSION_IS_3
|
||||
dnl #
|
||||
dnl # Tests if the $PYTHON_VERSION matches 2.x or 3.x.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_PYTHON_VERSION_IS_2],
|
||||
[test "${PYTHON_VERSION%%\.*}" = "2"])
|
||||
AC_DEFUN([ZFS_AC_PYTHON_VERSION_IS_3],
|
||||
[test "${PYTHON_VERSION%%\.*}" = "3"])
|
||||
|
||||
dnl #
|
||||
dnl # ZFS_AC_PYTHON_MODULE(module_name, [action-if-true], [action-if-false])
|
||||
dnl #
|
||||
@@ -46,42 +57,36 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
|
||||
[with_python=check])
|
||||
|
||||
AS_CASE([$with_python],
|
||||
[check],
|
||||
[AS_IF([test -x /usr/bin/python3],
|
||||
[PYTHON="python3"],
|
||||
[AS_IF([test -x /usr/bin/python2],
|
||||
[PYTHON="python2"],
|
||||
[PYTHON=""]
|
||||
)]
|
||||
)],
|
||||
[check], [AC_CHECK_PROGS([PYTHON], [python3 python2], [:])],
|
||||
[2*], [PYTHON="python${with_python}"],
|
||||
[*python2*], [PYTHON="${with_python}"],
|
||||
[3*], [PYTHON="python${with_python}"],
|
||||
[*python3*], [PYTHON="${with_python}"],
|
||||
[no], [PYTHON=""],
|
||||
[no], [PYTHON=":"],
|
||||
[AC_MSG_ERROR([Unknown --with-python value '$with_python'])]
|
||||
)
|
||||
|
||||
AS_IF([$PYTHON --version >/dev/null 2>&1], [ /bin/true ], [
|
||||
AC_MSG_ERROR([Cannot find $PYTHON in your system path])
|
||||
AS_IF([test $PYTHON != :], [
|
||||
AS_IF([$PYTHON --version >/dev/null 2>&1],
|
||||
[AM_PATH_PYTHON([2.6], [], [:])],
|
||||
[AC_MSG_ERROR([Cannot find $PYTHON in your system path])]
|
||||
)
|
||||
])
|
||||
|
||||
AM_PATH_PYTHON([2.6], [], [:])
|
||||
AM_CONDITIONAL([USING_PYTHON], [test "$PYTHON" != :])
|
||||
AM_CONDITIONAL([USING_PYTHON_2], [test "${PYTHON_VERSION:0:2}" = "2."])
|
||||
AM_CONDITIONAL([USING_PYTHON_3], [test "${PYTHON_VERSION:0:2}" = "3."])
|
||||
AM_CONDITIONAL([USING_PYTHON_2], [ZFS_AC_PYTHON_VERSION_IS_2])
|
||||
AM_CONDITIONAL([USING_PYTHON_3], [ZFS_AC_PYTHON_VERSION_IS_3])
|
||||
|
||||
dnl #
|
||||
dnl # Minimum supported Python versions for utilities:
|
||||
dnl # Python 2.6.x, or Python 3.4.x
|
||||
dnl #
|
||||
AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [
|
||||
ZFS_AC_PYTHON_VERSION([>= '2.6'], [ /bin/true ],
|
||||
AS_IF([ZFS_AC_PYTHON_VERSION_IS_2], [
|
||||
ZFS_AC_PYTHON_VERSION([>= '2.6'], [ true ],
|
||||
[AC_MSG_ERROR("Python >= 2.6.x is not available")])
|
||||
])
|
||||
|
||||
AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [
|
||||
ZFS_AC_PYTHON_VERSION([>= '3.4'], [ /bin/true ],
|
||||
AS_IF([ZFS_AC_PYTHON_VERSION_IS_3], [
|
||||
ZFS_AC_PYTHON_VERSION([>= '3.4'], [ true ],
|
||||
[AC_MSG_ERROR("Python >= 3.4.x is not available")])
|
||||
])
|
||||
|
||||
|
||||
@@ -18,7 +18,12 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
||||
DEFINE_PYZFS='--without pyzfs'
|
||||
])
|
||||
], [
|
||||
DEFINE_PYZFS=''
|
||||
AS_IF([test $PYTHON != :], [
|
||||
DEFINE_PYZFS=''
|
||||
], [
|
||||
enable_pyzfs=no
|
||||
DEFINE_PYZFS='--without pyzfs'
|
||||
])
|
||||
])
|
||||
AC_SUBST(DEFINE_PYZFS)
|
||||
|
||||
@@ -26,10 +31,10 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
||||
dnl # Require python-devel libraries
|
||||
dnl #
|
||||
AS_IF([test "x$enable_pyzfs" = xcheck -o "x$enable_pyzfs" = xyes], [
|
||||
AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [
|
||||
AS_IF([ZFS_AC_PYTHON_VERSION_IS_2], [
|
||||
PYTHON_REQUIRED_VERSION=">= '2.7.0'"
|
||||
], [
|
||||
AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [
|
||||
AS_IF([ZFS_AC_PYTHON_VERSION_IS_3], [
|
||||
PYTHON_REQUIRED_VERSION=">= '3.4.0'"
|
||||
], [
|
||||
AC_MSG_ERROR("Python $PYTHON_VERSION unknown")
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
dnl #
|
||||
dnl # 2.6.39 API change
|
||||
dnl #
|
||||
dnl # 33ee3b2e2eb9 kstrto*: converting strings to integers done (hopefully) right
|
||||
dnl #
|
||||
dnl # If kstrtoul() doesn't exist, fallback to use strict_strtoul() which has
|
||||
dnl # existed since 2.6.25.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KSTRTOUL], [
|
||||
AC_MSG_CHECKING([whether kstrtoul() exists])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/kernel.h>
|
||||
],[
|
||||
int ret __attribute__ ((unused)) = kstrtoul(NULL, 10, NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KSTRTOUL, 1, [kstrtoul() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
@@ -1,39 +0,0 @@
|
||||
dnl #
|
||||
dnl # 3.9 API change
|
||||
dnl # set_fs_pwd takes const struct path *
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_FS_PWD_WITH_CONST],
|
||||
tmp_flags="$EXTRA_KCFLAGS"
|
||||
EXTRA_KCFLAGS="-Werror"
|
||||
[AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/fs_struct.h>
|
||||
#include <linux/path.h>
|
||||
void (*const set_fs_pwd_func)
|
||||
(struct fs_struct *, const struct path *)
|
||||
= set_fs_pwd;
|
||||
],[
|
||||
return 0;
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
|
||||
[set_fs_pwd() needs const path *])
|
||||
],[
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/fs_struct.h>
|
||||
#include <linux/path.h>
|
||||
void (*const set_fs_pwd_func)
|
||||
(struct fs_struct *, struct path *)
|
||||
= set_fs_pwd;
|
||||
],[
|
||||
return 0;
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_ERROR(unknown)
|
||||
])
|
||||
])
|
||||
EXTRA_KCFLAGS="$tmp_flags"
|
||||
])
|
||||
+15
-7
@@ -144,7 +144,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/mm.h>
|
||||
|
||||
int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
|
||||
int shrinker_cb(int nr_to_scan, gfp_t gfp_mask) {
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.shrink = shrinker_cb,
|
||||
@@ -166,8 +168,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/mm.h>
|
||||
|
||||
int shrinker_cb(struct shrinker *, int nr_to_scan,
|
||||
gfp_t gfp_mask);
|
||||
int shrinker_cb(struct shrinker *shrink, int nr_to_scan,
|
||||
gfp_t gfp_mask) {
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.shrink = shrinker_cb,
|
||||
@@ -190,8 +194,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/mm.h>
|
||||
|
||||
int shrinker_cb(struct shrinker *,
|
||||
struct shrink_control *sc);
|
||||
int shrinker_cb(struct shrinker *shrink,
|
||||
struct shrink_control *sc) {
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.shrink = shrinker_cb,
|
||||
@@ -215,8 +221,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
|
||||
#include <linux/mm.h>
|
||||
|
||||
unsigned long shrinker_cb(
|
||||
struct shrinker *,
|
||||
struct shrink_control *sc);
|
||||
struct shrinker *shrink,
|
||||
struct shrink_control *sc) {
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.count_objects = shrinker_cb,
|
||||
|
||||
+4
-3
@@ -11,7 +11,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
||||
ZFS_AC_KERNEL_CONFIG
|
||||
ZFS_AC_KERNEL_CTL_NAME
|
||||
ZFS_AC_KERNEL_PDE_DATA
|
||||
ZFS_AC_KERNEL_SET_FS_PWD_WITH_CONST
|
||||
ZFS_AC_KERNEL_2ARGS_VFS_FSYNC
|
||||
ZFS_AC_KERNEL_FS_STRUCT_SPINLOCK
|
||||
ZFS_AC_KERNEL_KUIDGID_T
|
||||
@@ -167,6 +166,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
||||
ZFS_AC_KERNEL_TOTALHIGH_PAGES
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_KSTRTOUL
|
||||
|
||||
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
|
||||
KERNEL_MAKE="$KERNEL_MAKE O=$LINUX_OBJ"
|
||||
@@ -529,10 +529,11 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS], [
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([
|
||||
AS_IF([test "x$enable_linux_builtin" != xyes], [
|
||||
AC_MSG_ERROR([
|
||||
*** This kernel has unused symbols trimming enabled, please disable.
|
||||
*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
|
||||
])
|
||||
])])
|
||||
])
|
||||
|
||||
dnl #
|
||||
|
||||
@@ -878,7 +878,9 @@ mountroot()
|
||||
pool="$("${ZPOOL}" get name,guid -o name,value -H | \
|
||||
awk -v pool="${ZFS_RPOOL}" '$2 == pool { print $1 }')"
|
||||
if [ -n "$pool" ]; then
|
||||
ZFS_BOOTFS="${pool}/${ZFS_BOOTFS#*/}"
|
||||
# If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
|
||||
ZFS_BOOTFS=$(echo "$ZFS_BOOTFS" | \
|
||||
sed -e "s/$("${ZPOOL}" get guid -o value "$pool" -H)/$pool/g")
|
||||
ZFS_RPOOL="${pool}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ void spl_dumpstack(void);
|
||||
if (!(_verify3_left OP _verify3_right)) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (%px" #OP " %px)\n", \
|
||||
"failed (%px " #OP " %px)\n", \
|
||||
(void *) (_verify3_left), \
|
||||
(void *) (_verify3_right)); \
|
||||
} while (0)
|
||||
|
||||
@@ -28,4 +28,8 @@
|
||||
#define bcopy(src, dest, size) memmove(dest, src, size)
|
||||
#define bcmp(src, dest, size) memcmp((src), (dest), (size_t)(size))
|
||||
|
||||
#ifndef HAVE_KSTRTOUL
|
||||
#define kstrtoul strict_strtoul
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_SYS_STRINGS_H */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
|
||||
* Copyright 2017-2018 RackTop Systems.
|
||||
* Copyright (c) 2019 Datto Inc.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -2969,8 +2970,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
||||
|
||||
case ZFS_PROP_GUID:
|
||||
case ZFS_PROP_CREATETXG:
|
||||
case ZFS_PROP_OBJSETID:
|
||||
/*
|
||||
* GUIDs are stored as numbers, but they are identifiers.
|
||||
* These properties are stored as numbers, but they are
|
||||
* identifiers.
|
||||
* We don't want them to be pretty printed, because pretty
|
||||
* printing mangles the ID into a truncated and useless value.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
.TH raidz_test 1 "2016" "ZFS on Linux" "User Commands"
|
||||
|
||||
.SH NAME
|
||||
\fBraidz_test\fR \- raidz implementation verification and bencmarking tool
|
||||
\fBraidz_test\fR \- raidz implementation verification and benchmarking tool
|
||||
.SH SYNOPSIS
|
||||
.LP
|
||||
.BI "raidz_test <options>"
|
||||
|
||||
@@ -643,11 +643,7 @@ EXPORT_SYMBOL(areleasef);
|
||||
|
||||
|
||||
static void
|
||||
#ifdef HAVE_SET_FS_PWD_WITH_CONST
|
||||
vn_set_fs_pwd(struct fs_struct *fs, const struct path *path)
|
||||
#else
|
||||
vn_set_fs_pwd(struct fs_struct *fs, struct path *path)
|
||||
#endif /* HAVE_SET_FS_PWD_WITH_CONST */
|
||||
{
|
||||
struct path old_pwd;
|
||||
|
||||
|
||||
+2
-2
@@ -5480,7 +5480,7 @@ static boolean_t
|
||||
arc_is_overflowing(void)
|
||||
{
|
||||
/* Always allow at least one block of overflow */
|
||||
uint64_t overflow = MAX(SPA_MAXBLOCKSIZE,
|
||||
int64_t overflow = MAX(SPA_MAXBLOCKSIZE,
|
||||
arc_c >> zfs_arc_overflow_shift);
|
||||
|
||||
/*
|
||||
@@ -5492,7 +5492,7 @@ arc_is_overflowing(void)
|
||||
* in the ARC. In practice, that's in the tens of MB, which is low
|
||||
* enough to be safe.
|
||||
*/
|
||||
return (aggsum_lower_bound(&arc_size) >= arc_c + overflow);
|
||||
return (aggsum_lower_bound(&arc_size) >= (int64_t)arc_c + overflow);
|
||||
}
|
||||
|
||||
static abd_t *
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ bqueue_enqueue(bqueue_t *q, void *data, uint64_t item_size)
|
||||
mutex_enter(&q->bq_lock);
|
||||
obj2node(q, data)->bqn_size = item_size;
|
||||
while (q->bq_size + item_size > q->bq_maxsize) {
|
||||
cv_wait(&q->bq_add_cv, &q->bq_lock);
|
||||
cv_wait_sig(&q->bq_add_cv, &q->bq_lock);
|
||||
}
|
||||
q->bq_size += item_size;
|
||||
list_insert_tail(&q->bq_list, data);
|
||||
@@ -91,7 +91,7 @@ bqueue_dequeue(bqueue_t *q)
|
||||
uint64_t item_size;
|
||||
mutex_enter(&q->bq_lock);
|
||||
while (q->bq_size == 0) {
|
||||
cv_wait(&q->bq_pop_cv, &q->bq_lock);
|
||||
cv_wait_sig(&q->bq_pop_cv, &q->bq_lock);
|
||||
}
|
||||
ret = list_remove_head(&q->bq_list);
|
||||
ASSERT3P(ret, !=, NULL);
|
||||
|
||||
+5
-30
@@ -719,8 +719,8 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum, uint64_t *l1blks)
|
||||
uint64_t blks;
|
||||
uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1);
|
||||
/* bytes of data covered by a level-1 indirect block */
|
||||
uint64_t iblkrange =
|
||||
dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT);
|
||||
uint64_t iblkrange = (uint64_t)dn->dn_datablksz *
|
||||
EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT);
|
||||
|
||||
ASSERT3U(minimum, <=, *start);
|
||||
|
||||
@@ -2373,39 +2373,14 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
|
||||
return (err);
|
||||
|
||||
/*
|
||||
* Check if there are dirty data blocks or frees which have not been
|
||||
* synced. Dirty spill and bonus blocks which are external to the
|
||||
* object can ignored when reporting holes.
|
||||
* Check if dnode is dirty
|
||||
*/
|
||||
mutex_enter(&dn->dn_mtx);
|
||||
for (i = 0; i < TXG_SIZE; i++) {
|
||||
if (multilist_link_active(&dn->dn_dirty_link[i])) {
|
||||
|
||||
if (dn->dn_free_ranges[i] != NULL) {
|
||||
clean = B_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
list_t *list = &dn->dn_dirty_records[i];
|
||||
dbuf_dirty_record_t *dr;
|
||||
|
||||
for (dr = list_head(list); dr != NULL;
|
||||
dr = list_next(list, dr)) {
|
||||
dmu_buf_impl_t *db = dr->dr_dbuf;
|
||||
|
||||
if (db->db_blkid == DMU_SPILL_BLKID ||
|
||||
db->db_blkid == DMU_BONUS_BLKID)
|
||||
continue;
|
||||
|
||||
clean = B_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clean == B_FALSE)
|
||||
clean = B_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_exit(&dn->dn_mtx);
|
||||
|
||||
/*
|
||||
* If compatibility option is on, sync any current changes before
|
||||
|
||||
@@ -158,9 +158,16 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
|
||||
} else {
|
||||
/*
|
||||
* If we are not forcing, there must be no
|
||||
* changes since fromsnap.
|
||||
* changes since fromsnap. Raw sends have an
|
||||
* additional constraint that requires that
|
||||
* no "noop" snapshots exist between fromsnap
|
||||
* and tosnap for the IVset checking code to
|
||||
* work properly.
|
||||
*/
|
||||
if (dsl_dataset_modified_since_snap(ds, snap)) {
|
||||
if (dsl_dataset_modified_since_snap(ds, snap) ||
|
||||
(raw &&
|
||||
dsl_dataset_phys(ds)->ds_prev_snap_obj !=
|
||||
snap->ds_object)) {
|
||||
dsl_dataset_rele(snap, FTAG);
|
||||
return (SET_ERROR(ETXTBSY));
|
||||
}
|
||||
|
||||
+15
-1
@@ -384,7 +384,21 @@ dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks,
|
||||
}
|
||||
}
|
||||
|
||||
if (trunc) {
|
||||
/*
|
||||
* Do not truncate the maxblkid if we are performing a raw
|
||||
* receive. The raw receive sets the maxblkid manually and
|
||||
* must not be overridden. Usually, the last DRR_FREE record
|
||||
* will be at the maxblkid, because the source system sets
|
||||
* the maxblkid when truncating. However, if the last block
|
||||
* was freed by overwriting with zeros and being compressed
|
||||
* away to a hole, the source system will generate a DRR_FREE
|
||||
* record while leaving the maxblkid after the end of that
|
||||
* record. In this case we need to leave the maxblkid as
|
||||
* indicated in the DRR_OBJECT record, so that it matches the
|
||||
* source system, ensuring that the cryptographic hashes will
|
||||
* match.
|
||||
*/
|
||||
if (trunc && !dn->dn_objset->os_raw_receive) {
|
||||
ASSERTV(uint64_t off);
|
||||
dn->dn_phys->dn_maxblkid = blkid == 0 ? 0 : blkid - 1;
|
||||
|
||||
|
||||
+10
-1
@@ -3025,8 +3025,10 @@ dsl_scan_async_block_should_pause(dsl_scan_t *scn)
|
||||
if (zfs_recover)
|
||||
return (B_FALSE);
|
||||
|
||||
if (scn->scn_visited_this_txg >= zfs_async_block_max_blocks)
|
||||
if (zfs_async_block_max_blocks != 0 &&
|
||||
scn->scn_visited_this_txg >= zfs_async_block_max_blocks) {
|
||||
return (B_TRUE);
|
||||
}
|
||||
|
||||
elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
|
||||
return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
|
||||
@@ -3629,6 +3631,13 @@ count_block(dsl_scan_t *scn, zfs_all_blkstats_t *zab, const blkptr_t *bp)
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Don't count embedded bp's, since we already did the work of
|
||||
* scanning these when we scanned the containing block.
|
||||
*/
|
||||
if (BP_IS_EMBEDDED(bp))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Update the spa's stats on how many bytes we have issued.
|
||||
* Sequential scrubs create a zio for each DVA of the bp. Each
|
||||
|
||||
@@ -2102,8 +2102,8 @@ spa_import_progress_destroy(void)
|
||||
spa_history_list_t *shl = spa_import_progress_list;
|
||||
procfs_list_uninstall(&shl->procfs_list);
|
||||
spa_import_progress_truncate(shl, 0);
|
||||
kmem_free(shl, sizeof (spa_history_list_t));
|
||||
procfs_list_destroy(&shl->procfs_list);
|
||||
kmem_free(shl, sizeof (spa_history_list_t));
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+1
-4
@@ -1852,13 +1852,10 @@ vdev_open(vdev_t *vd)
|
||||
|
||||
/*
|
||||
* Track the min and max ashift values for normal data devices.
|
||||
*
|
||||
* DJB - TBD these should perhaps be tracked per allocation class
|
||||
* (e.g. spa_min_ashift is used to round up post compression buffers)
|
||||
*/
|
||||
if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
|
||||
vd->vdev_alloc_bias == VDEV_BIAS_NONE &&
|
||||
vd->vdev_aux == NULL) {
|
||||
vd->vdev_islog == 0 && vd->vdev_aux == NULL) {
|
||||
if (vd->vdev_ashift > spa->spa_max_ashift)
|
||||
spa->spa_max_ashift = vd->vdev_ashift;
|
||||
if (vd->vdev_ashift < spa->spa_min_ashift)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014, 2017 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
@@ -902,7 +903,7 @@ vdev_obsolete_sm_object(vdev_t *vd, uint64_t *sm_obj)
|
||||
}
|
||||
|
||||
int error = zap_lookup(vd->vdev_spa->spa_meta_objset, vd->vdev_top_zap,
|
||||
VDEV_TOP_ZAP_INDIRECT_OBSOLETE_SM, sizeof (sm_obj), 1, sm_obj);
|
||||
VDEV_TOP_ZAP_INDIRECT_OBSOLETE_SM, sizeof (uint64_t), 1, sm_obj);
|
||||
if (error == ENOENT) {
|
||||
*sm_obj = 0;
|
||||
error = 0;
|
||||
|
||||
+9
-12
@@ -1514,6 +1514,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
|
||||
nvlist_t *zplprops = NULL;
|
||||
dsl_crypto_params_t *dcp = NULL;
|
||||
char *spa_name = zc->zc_name;
|
||||
boolean_t unload_wkey = B_TRUE;
|
||||
|
||||
if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size,
|
||||
zc->zc_iflags, &config)))
|
||||
@@ -1541,11 +1542,8 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
|
||||
(void) nvlist_lookup_nvlist(props, ZPOOL_ROOTFS_PROPS, &nvl);
|
||||
if (nvl) {
|
||||
error = nvlist_dup(nvl, &rootprops, KM_SLEEP);
|
||||
if (error != 0) {
|
||||
nvlist_free(config);
|
||||
nvlist_free(props);
|
||||
return (error);
|
||||
}
|
||||
if (error != 0)
|
||||
goto pool_props_bad;
|
||||
(void) nvlist_remove_all(props, ZPOOL_ROOTFS_PROPS);
|
||||
}
|
||||
|
||||
@@ -1553,11 +1551,8 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
|
||||
&hidden_args);
|
||||
error = dsl_crypto_params_create_nvlist(DCP_CMD_NONE,
|
||||
rootprops, hidden_args, &dcp);
|
||||
if (error != 0) {
|
||||
nvlist_free(config);
|
||||
nvlist_free(props);
|
||||
return (error);
|
||||
}
|
||||
if (error != 0)
|
||||
goto pool_props_bad;
|
||||
(void) nvlist_remove_all(props, ZPOOL_HIDDEN_ARGS);
|
||||
|
||||
VERIFY(nvlist_alloc(&zplprops, NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
||||
@@ -1577,15 +1572,17 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
|
||||
* Set the remaining root properties
|
||||
*/
|
||||
if (!error && (error = zfs_set_prop_nvlist(spa_name,
|
||||
ZPROP_SRC_LOCAL, rootprops, NULL)) != 0)
|
||||
ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) {
|
||||
(void) spa_destroy(spa_name);
|
||||
unload_wkey = B_FALSE; /* spa_destroy() unloads wrapping keys */
|
||||
}
|
||||
|
||||
pool_props_bad:
|
||||
nvlist_free(rootprops);
|
||||
nvlist_free(zplprops);
|
||||
nvlist_free(config);
|
||||
nvlist_free(props);
|
||||
dsl_crypto_params_free(dcp, !!error);
|
||||
dsl_crypto_params_free(dcp, unload_wkey && !!error);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
@@ -4526,8 +4526,10 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
|
||||
unlock_page(pp);
|
||||
rangelock_exit(lr);
|
||||
|
||||
if (wbc->sync_mode != WB_SYNC_NONE)
|
||||
wait_on_page_writeback(pp);
|
||||
if (wbc->sync_mode != WB_SYNC_NONE) {
|
||||
if (PageWriteback(pp))
|
||||
wait_on_page_bit(pp, PG_writeback);
|
||||
}
|
||||
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (0);
|
||||
|
||||
@@ -1255,7 +1255,7 @@ zfs_rezget(znode_t *zp)
|
||||
ZFS_TIME_DECODE(&ZTOI(zp)->i_mtime, mtime);
|
||||
ZFS_TIME_DECODE(&ZTOI(zp)->i_ctime, ctime);
|
||||
|
||||
if (gen != ZTOI(zp)->i_generation) {
|
||||
if ((uint32_t)gen != ZTOI(zp)->i_generation) {
|
||||
zfs_znode_dmu_fini(zp);
|
||||
zfs_znode_hold_exit(zfsvfs, zh);
|
||||
return (SET_ERROR(EIO));
|
||||
|
||||
+2
-2
@@ -178,9 +178,9 @@ EOF
|
||||
else
|
||||
cat <<EOF
|
||||
%post -n kmod-${kmodname}-${kernel_uname_r}
|
||||
[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
|
||||
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
|
||||
%postun -n kmod-${kmodname}-${kernel_uname_r}
|
||||
[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
|
||||
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
@@ -635,7 +635,7 @@ tests = ['filesystem_count', 'filesystem_limit', 'snapshot_count',
|
||||
tags = ['functional', 'limits']
|
||||
|
||||
[tests/functional/link_count]
|
||||
tests = ['link_count_001']
|
||||
tests = ['link_count_001', 'link_count_root_inode.ksh']
|
||||
tags = ['functional', 'link_count']
|
||||
|
||||
[tests/functional/migration]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
|
||||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
|
||||
Executable → Regular
@@ -1,7 +1,5 @@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/alloc_class
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
alloc_class.cfg \
|
||||
alloc_class.kshlib \
|
||||
setup.ksh \
|
||||
cleanup.ksh \
|
||||
alloc_class_001_pos.ksh \
|
||||
@@ -17,3 +15,7 @@ dist_pkgdata_SCRIPTS = \
|
||||
alloc_class_011_neg.ksh \
|
||||
alloc_class_012_pos.ksh \
|
||||
alloc_class_013_pos.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
alloc_class.cfg \
|
||||
alloc_class.kshlib
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
# N 1 1 no keyformat given, but crypt off
|
||||
# Y 0 0 no no keyformat specified for new key
|
||||
# Y 0 1 no no keyformat specified for new key
|
||||
# Y 1 1 no unsupported combination of non-encryption props
|
||||
# Y 1 0 yes new encryption root
|
||||
# Y 1 1 yes new encryption root
|
||||
#
|
||||
@@ -83,6 +84,10 @@ log_mustnot zpool create -O encryption=on $TESTPOOL $DISKS
|
||||
log_mustnot zpool create -O encryption=on -O keylocation=prompt \
|
||||
$TESTPOOL $DISKS
|
||||
|
||||
log_mustnot eval "echo $PASSPHRASE | zpool create -O encryption=on" \
|
||||
"-O keyformat=passphrase -O keylocation=prompt" \
|
||||
"-o feature@lz4_compress=disabled -O compression=lz4 $TESTPOOL $DISKS"
|
||||
|
||||
log_must eval "echo $PASSPHRASE | zpool create -O encryption=on" \
|
||||
"-O keyformat=passphrase $TESTPOOL $DISKS"
|
||||
log_must zpool destroy $TESTPOOL
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#!/bin/ksh
|
||||
|
||||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
|
||||
@@ -3,7 +3,6 @@ dist_pkgdata_SCRIPTS = \
|
||||
cleanup.ksh \
|
||||
zpool_initialize_attach_detach_add_remove.ksh \
|
||||
zpool_initialize_import_export.ksh \
|
||||
zpool_initialize.kshlib \
|
||||
zpool_initialize_offline_export_import_online.ksh \
|
||||
zpool_initialize_online_offline.ksh \
|
||||
zpool_initialize_split.ksh \
|
||||
|
||||
Executable → Regular
@@ -2,7 +2,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_trim
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
setup.ksh \
|
||||
cleanup.ksh \
|
||||
zpool_trim.kshlib \
|
||||
zpool_trim_attach_detach_add_remove.ksh \
|
||||
zpool_trim_import_export.ksh \
|
||||
zpool_trim_multiple.ksh \
|
||||
@@ -20,3 +19,6 @@ dist_pkgdata_SCRIPTS = \
|
||||
zpool_trim_unsupported_vdevs.ksh \
|
||||
zpool_trim_verify_checksums.ksh \
|
||||
zpool_trim_verify_trimmed.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
zpool_trim.kshlib
|
||||
|
||||
@@ -44,16 +44,20 @@
|
||||
|
||||
function cleanup
|
||||
{
|
||||
if [ -e $TEST_BASE_DIR/zfs_001_neg.$$.txt ]
|
||||
if [ -e "$TEMPFILE" ]
|
||||
then
|
||||
rm $TEST_BASE_DIR/zfs_001_neg.$$.txt
|
||||
rm -f "$TEMPFILE"
|
||||
fi
|
||||
}
|
||||
|
||||
log_onexit cleanup
|
||||
log_assert "zfs shows a usage message when run as a user"
|
||||
|
||||
eval "zfs > $TEST_BASE_DIR/zfs_001_neg.$$.txt 2>&1"
|
||||
log_must grep "usage: zfs command args" $TEST_BASE_DIR/zfs_001_neg.$$.txt
|
||||
TEMPFILE="$TEST_BASE_DIR/zfs_001_neg.$$.txt"
|
||||
|
||||
eval "zfs > $TEMPFILE 2>&1"
|
||||
log_must grep "usage: zfs command args" "$TEMPFILE"
|
||||
|
||||
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
|
||||
|
||||
log_pass "zfs shows a usage message when run as a user"
|
||||
|
||||
@@ -45,16 +45,20 @@
|
||||
|
||||
function cleanup
|
||||
{
|
||||
if [ -e $TEST_BASE_DIR/zpool_001_neg.$$.txt ]
|
||||
if [ -e "$TEMPFILE" ]
|
||||
then
|
||||
rm $TEST_BASE_DIR/zpool_001_neg.$$.txt
|
||||
rm -f "$TEMPFILE"
|
||||
fi
|
||||
}
|
||||
|
||||
TEMPFILE="$TEST_BASE_DIR/zpool_001_neg.$$.txt"
|
||||
|
||||
log_onexit cleanup
|
||||
log_assert "zpool shows a usage message when run as a user"
|
||||
|
||||
eval "zpool > $TEST_BASE_DIR/zpool_001_neg.$$.txt 2>&1"
|
||||
log_must grep "usage: zpool command args" $TEST_BASE_DIR/zpool_001_neg.$$.txt
|
||||
eval "zpool > $TEMPFILE 2>&1"
|
||||
log_must grep "usage: zpool command args" "$TEMPFILE"
|
||||
|
||||
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
|
||||
|
||||
log_pass "zpool shows a usage message when run as a user"
|
||||
|
||||
@@ -2,8 +2,7 @@ include $(top_srcdir)/config/Rules.am
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/lib/libspl/include
|
||||
LDADD = $(top_srcdir)/lib/libicp/libicp.la
|
||||
LDADD += $(top_srcdir)/lib/libzpool/libzpool.la
|
||||
LDADD = $(top_srcdir)/lib/libzpool/libzpool.la
|
||||
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
|
||||
@@ -2,4 +2,5 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/link_count
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
cleanup.ksh \
|
||||
setup.ksh \
|
||||
link_count_001.ksh
|
||||
link_count_001.ksh \
|
||||
link_count_root_inode.ksh
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
#!/bin/ksh
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2019 by Tomohiro Kusumi. All rights reserved.
|
||||
#
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# Verify root inode (directory) has correct link count.
|
||||
#
|
||||
# STRATEGY:
|
||||
# 1. Create pool and fs.
|
||||
# 2. Test link count of root inode.
|
||||
# 3. Create directories and test link count of root inode.
|
||||
# 4. Delete directories and test link count of root inode.
|
||||
# 5. Create regular file and test link count of root inode.
|
||||
# 6. Delete regular file and test link count of root inode.
|
||||
#
|
||||
|
||||
function assert_link_count
|
||||
{
|
||||
typeset dirpath="$1"
|
||||
typeset value="$2"
|
||||
|
||||
log_must test "$(ls -ld $dirpath | awk '{ print $2 }')" == "$value"
|
||||
}
|
||||
|
||||
verify_runnable "both"
|
||||
|
||||
log_note "Verify root inode (directory) has correct link count."
|
||||
|
||||
# Delete a directory from link_count_001.ksh.
|
||||
if [ -d "${TESTDIR}" -a -d "${TESTDIR}/tmp" ]; then
|
||||
log_must rm -rf ${TESTDIR}/tmp
|
||||
fi
|
||||
|
||||
#
|
||||
# Test with hidden '.zfs' directory.
|
||||
# This also tests general directories.
|
||||
#
|
||||
log_note "Testing with snapdir set to hidden (default)"
|
||||
|
||||
for dst in $TESTPOOL $TESTPOOL/$TESTFS
|
||||
do
|
||||
typeset mtpt=$(get_prop mountpoint $dst)
|
||||
log_must zfs set snapdir=hidden $dst
|
||||
log_must test -d "$mtpt/.zfs"
|
||||
if test -n "$(ls $mtpt)"; then
|
||||
ls $mtpt
|
||||
log_note "$mtpt not empty, skipping"
|
||||
continue
|
||||
fi
|
||||
assert_link_count $mtpt 2
|
||||
|
||||
log_must mkdir $mtpt/a
|
||||
assert_link_count $mtpt 3
|
||||
log_must rmdir $mtpt/a
|
||||
assert_link_count $mtpt 2
|
||||
|
||||
log_must mkdir -p $mtpt/a/b
|
||||
assert_link_count $mtpt 3
|
||||
log_must rmdir $mtpt/a/b
|
||||
log_must rmdir $mtpt/a
|
||||
assert_link_count $mtpt 2
|
||||
|
||||
log_must touch $mtpt/a
|
||||
assert_link_count $mtpt 2
|
||||
log_must rm $mtpt/a
|
||||
assert_link_count $mtpt 2
|
||||
done
|
||||
|
||||
#
|
||||
# Test with visible '.zfs' directory.
|
||||
#
|
||||
log_note "Testing with snapdir set to visible"
|
||||
|
||||
for dst in $TESTPOOL $TESTPOOL/$TESTFS
|
||||
do
|
||||
typeset mtpt=$(get_prop mountpoint $dst)
|
||||
log_must zfs set snapdir=visible $dst
|
||||
log_must test -d "$mtpt/.zfs"
|
||||
if test -n "$(ls $mtpt)"; then
|
||||
ls $mtpt
|
||||
log_note "$mtpt not empty, skipping"
|
||||
continue
|
||||
fi
|
||||
assert_link_count $mtpt 3
|
||||
|
||||
log_must mkdir $mtpt/a
|
||||
assert_link_count $mtpt 4
|
||||
log_must rmdir $mtpt/a
|
||||
assert_link_count $mtpt 3
|
||||
|
||||
log_must mkdir -p $mtpt/a/b
|
||||
assert_link_count $mtpt 4
|
||||
log_must rmdir $mtpt/a/b
|
||||
log_must rmdir $mtpt/a
|
||||
assert_link_count $mtpt 3
|
||||
|
||||
log_must touch $mtpt/a
|
||||
assert_link_count $mtpt 3
|
||||
log_must rm $mtpt/a
|
||||
assert_link_count $mtpt 3
|
||||
done
|
||||
|
||||
log_pass "Verify root inode (directory) has correct link count passed"
|
||||
@@ -28,6 +28,9 @@ dist_pkgdata_SCRIPTS = \
|
||||
removal_with_send.ksh removal_with_send_recv.ksh \
|
||||
removal_with_snapshot.ksh removal_with_write.ksh \
|
||||
removal_with_zdb.ksh remove_mirror.ksh remove_mirror_sanity.ksh \
|
||||
remove_raidz.ksh remove_expanded.ksh removal.kshlib
|
||||
remove_raidz.ksh remove_expanded.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
removal.kshlib
|
||||
|
||||
pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/removal
|
||||
|
||||
@@ -2,28 +2,28 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/reservation
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
setup.ksh \
|
||||
cleanup.ksh \
|
||||
reservation_001_pos.sh \
|
||||
reservation_002_pos.sh \
|
||||
reservation_003_pos.sh \
|
||||
reservation_004_pos.sh \
|
||||
reservation_005_pos.sh \
|
||||
reservation_006_pos.sh \
|
||||
reservation_007_pos.sh \
|
||||
reservation_008_pos.sh \
|
||||
reservation_009_pos.sh \
|
||||
reservation_010_pos.sh \
|
||||
reservation_011_pos.sh \
|
||||
reservation_012_pos.sh \
|
||||
reservation_013_pos.sh \
|
||||
reservation_014_pos.sh \
|
||||
reservation_015_pos.sh \
|
||||
reservation_016_pos.sh \
|
||||
reservation_017_pos.sh \
|
||||
reservation_018_pos.sh \
|
||||
reservation_019_pos.sh \
|
||||
reservation_020_pos.sh \
|
||||
reservation_021_neg.sh \
|
||||
reservation_022_pos.sh
|
||||
reservation_001_pos.ksh \
|
||||
reservation_002_pos.ksh \
|
||||
reservation_003_pos.ksh \
|
||||
reservation_004_pos.ksh \
|
||||
reservation_005_pos.ksh \
|
||||
reservation_006_pos.ksh \
|
||||
reservation_007_pos.ksh \
|
||||
reservation_008_pos.ksh \
|
||||
reservation_009_pos.ksh \
|
||||
reservation_010_pos.ksh \
|
||||
reservation_011_pos.ksh \
|
||||
reservation_012_pos.ksh \
|
||||
reservation_013_pos.ksh \
|
||||
reservation_014_pos.ksh \
|
||||
reservation_015_pos.ksh \
|
||||
reservation_016_pos.ksh \
|
||||
reservation_017_pos.ksh \
|
||||
reservation_018_pos.ksh \
|
||||
reservation_019_pos.ksh \
|
||||
reservation_020_pos.ksh \
|
||||
reservation_021_neg.ksh \
|
||||
reservation_022_pos.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
reservation.cfg \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/perf
|
||||
dist_pkgdata_SCRIPTS = \
|
||||
dist_pkgdata_DATA = \
|
||||
nfs-sample.cfg \
|
||||
perf.shlib
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/ksh
|
||||
#!/bin/ksh
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user