mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92e0d9d183 | |||
| 232fc23c6e | |||
| 11bdc5c8e8 | |||
| 04b02785b6 | |||
| f22254283a | |||
| 7319a73921 | |||
| 596cfb6b15 | |||
| f806306ce0 | |||
| f33b298346 | |||
| 04fcf13de0 | |||
| 37dbf91c8a | |||
| be697f4339 | |||
| c07a8660f0 | |||
| ea62fb4ab7 | |||
| 5aca6e1092 | |||
| d72e004715 | |||
| 9ef565a185 | |||
| 0e72f5fb83 | |||
| e9897e542d | |||
| 70b1b5bb98 | |||
| a2aabac123 | |||
| 3207803abf | |||
| 6219190d7f | |||
| 24a6d8316a | |||
| e23ed1b330 | |||
| 572114d846 | |||
| 6af8e80310 | |||
| f8a124b104 | |||
| 689c53f2c5 | |||
| 0156253d29 | |||
| 3e0962a236 | |||
| 3c0b8c874b | |||
| b586ea5d93 | |||
| 138d2b29dd | |||
| 5371d8dae7 | |||
| a75af541cf | |||
| 75fbe7eb99 | |||
| d0f350c962 | |||
| 2f2d6bece8 | |||
| fbbc375d43 | |||
| e84a2ed7a8 | |||
| f28c7302cb | |||
| 4767037bcf | |||
| d50ce5c9ec | |||
| 05732da4d1 | |||
| 8f7826f73b |
@@ -9,7 +9,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [18.04, 20.04]
|
os: [20.04]
|
||||||
runs-on: ubuntu-${{ matrix.os }}
|
runs-on: ubuntu-${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
The [OpenZFS Code of Conduct](http://www.open-zfs.org/wiki/Code_of_Conduct)
|
The [OpenZFS Code of Conduct](https://openzfs.org/wiki/Code_of_Conduct)
|
||||||
applies to spaces associated with the OpenZFS project, including GitHub.
|
applies to spaces associated with the OpenZFS project, including GitHub.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.1.7
|
Version: 2.1.9
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 6.0
|
Linux-Maximum: 6.1
|
||||||
Linux-Minimum: 3.10
|
Linux-Minimum: 3.10
|
||||||
|
|||||||
@@ -525,6 +525,7 @@ typedef struct dev_data {
|
|||||||
boolean_t dd_islabeled;
|
boolean_t dd_islabeled;
|
||||||
uint64_t dd_pool_guid;
|
uint64_t dd_pool_guid;
|
||||||
uint64_t dd_vdev_guid;
|
uint64_t dd_vdev_guid;
|
||||||
|
uint64_t dd_new_vdev_guid;
|
||||||
const char *dd_new_devid;
|
const char *dd_new_devid;
|
||||||
} dev_data_t;
|
} dev_data_t;
|
||||||
|
|
||||||
@@ -535,6 +536,7 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
uint_t c, children;
|
uint_t c, children;
|
||||||
nvlist_t **child;
|
nvlist_t **child;
|
||||||
|
uint64_t guid = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First iterate over any children.
|
* First iterate over any children.
|
||||||
@@ -562,17 +564,14 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
/* once a vdev was matched and processed there is nothing left to do */
|
/* once a vdev was matched and processed there is nothing left to do */
|
||||||
if (dp->dd_found)
|
if (dp->dd_found)
|
||||||
return;
|
return;
|
||||||
|
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID, &guid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Match by GUID if available otherwise fallback to devid or physical
|
* Match by GUID if available otherwise fallback to devid or physical
|
||||||
*/
|
*/
|
||||||
if (dp->dd_vdev_guid != 0) {
|
if (dp->dd_vdev_guid != 0) {
|
||||||
uint64_t guid;
|
if (guid != dp->dd_vdev_guid)
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_GUID,
|
|
||||||
&guid) != 0 || guid != dp->dd_vdev_guid) {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched on %llu", guid);
|
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched on %llu", guid);
|
||||||
dp->dd_found = B_TRUE;
|
dp->dd_found = B_TRUE;
|
||||||
|
|
||||||
@@ -582,6 +581,12 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
* illumos, substring matching is not required to accommodate
|
* illumos, substring matching is not required to accommodate
|
||||||
* the partition suffix. An exact match will be present in
|
* the partition suffix. An exact match will be present in
|
||||||
* the dp->dd_compare value.
|
* the dp->dd_compare value.
|
||||||
|
* If the attached disk already contains a vdev GUID, it means
|
||||||
|
* the disk is not clean. In such a scenario, the physical path
|
||||||
|
* would be a match that makes the disk faulted when trying to
|
||||||
|
* online it. So, we would only want to proceed if either GUID
|
||||||
|
* matches with the last attached disk or the disk is in clean
|
||||||
|
* state.
|
||||||
*/
|
*/
|
||||||
if (nvlist_lookup_string(nvl, dp->dd_prop, &path) != 0 ||
|
if (nvlist_lookup_string(nvl, dp->dd_prop, &path) != 0 ||
|
||||||
strcmp(dp->dd_compare, path) != 0) {
|
strcmp(dp->dd_compare, path) != 0) {
|
||||||
@@ -589,6 +594,12 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data)
|
|||||||
__func__, dp->dd_compare, path);
|
__func__, dp->dd_compare, path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (dp->dd_new_vdev_guid != 0 && dp->dd_new_vdev_guid != guid) {
|
||||||
|
zed_log_msg(LOG_INFO, " %s: no match (GUID:%llu"
|
||||||
|
" != vdev GUID:%llu)", __func__,
|
||||||
|
dp->dd_new_vdev_guid, guid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched %s on %s",
|
zed_log_msg(LOG_INFO, " zfs_iter_vdev: matched %s on %s",
|
||||||
dp->dd_prop, path);
|
dp->dd_prop, path);
|
||||||
@@ -670,7 +681,7 @@ zfs_iter_pool(zpool_handle_t *zhp, void *data)
|
|||||||
*/
|
*/
|
||||||
static boolean_t
|
static boolean_t
|
||||||
devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
||||||
boolean_t is_slice)
|
boolean_t is_slice, uint64_t new_vdev_guid)
|
||||||
{
|
{
|
||||||
dev_data_t data = { 0 };
|
dev_data_t data = { 0 };
|
||||||
|
|
||||||
@@ -680,6 +691,7 @@ devphys_iter(const char *physical, const char *devid, zfs_process_func_t func,
|
|||||||
data.dd_found = B_FALSE;
|
data.dd_found = B_FALSE;
|
||||||
data.dd_islabeled = is_slice;
|
data.dd_islabeled = is_slice;
|
||||||
data.dd_new_devid = devid; /* used by auto replace code */
|
data.dd_new_devid = devid; /* used by auto replace code */
|
||||||
|
data.dd_new_vdev_guid = new_vdev_guid;
|
||||||
|
|
||||||
(void) zpool_iter(g_zfshdl, zfs_iter_pool, &data);
|
(void) zpool_iter(g_zfshdl, zfs_iter_pool, &data);
|
||||||
|
|
||||||
@@ -848,7 +860,7 @@ zfs_deliver_add(nvlist_t *nvl, boolean_t is_lofi)
|
|||||||
if (devid_iter(devid, zfs_process_add, is_slice))
|
if (devid_iter(devid, zfs_process_add, is_slice))
|
||||||
return (0);
|
return (0);
|
||||||
if (devpath != NULL && devphys_iter(devpath, devid, zfs_process_add,
|
if (devpath != NULL && devphys_iter(devpath, devid, zfs_process_add,
|
||||||
is_slice))
|
is_slice, vdev_guid))
|
||||||
return (0);
|
return (0);
|
||||||
if (vdev_guid != 0)
|
if (vdev_guid != 0)
|
||||||
(void) guid_iter(pool_guid, vdev_guid, devid, zfs_process_add,
|
(void) guid_iter(pool_guid, vdev_guid, devid, zfs_process_add,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if [ "${ZEVENT_VDEV_STATE_STR}" != "FAULTED" ] \
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
umask 077
|
umask 077
|
||||||
note_subject="ZFS device fault for pool ${ZEVENT_POOL_GUID} on $(hostname)"
|
note_subject="ZFS device fault for pool ${ZEVENT_POOL} on $(hostname)"
|
||||||
note_pathname="$(mktemp)"
|
note_pathname="$(mktemp)"
|
||||||
{
|
{
|
||||||
if [ "${ZEVENT_VDEV_STATE_STR}" = "FAULTED" ] ; then
|
if [ "${ZEVENT_VDEV_STATE_STR}" = "FAULTED" ] ; then
|
||||||
@@ -65,7 +65,7 @@ note_pathname="$(mktemp)"
|
|||||||
[ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
|
[ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
|
||||||
[ -n "${ZEVENT_VDEV_DEVID}" ] && echo " devid: ${ZEVENT_VDEV_DEVID}"
|
[ -n "${ZEVENT_VDEV_DEVID}" ] && echo " devid: ${ZEVENT_VDEV_DEVID}"
|
||||||
|
|
||||||
echo " pool: ${ZEVENT_POOL_GUID}"
|
echo " pool: ${ZEVENT_POOL} (${ZEVENT_POOL_GUID})"
|
||||||
|
|
||||||
} > "${note_pathname}"
|
} > "${note_pathname}"
|
||||||
|
|
||||||
|
|||||||
@@ -5414,7 +5414,13 @@ print_zpool_dir_scripts(char *dirpath)
|
|||||||
if ((dir = opendir(dirpath)) != NULL) {
|
if ((dir = opendir(dirpath)) != NULL) {
|
||||||
/* print all the files and directories within directory */
|
/* print all the files and directories within directory */
|
||||||
while ((ent = readdir(dir)) != NULL) {
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
sprintf(fullpath, "%s/%s", dirpath, ent->d_name);
|
if (snprintf(fullpath, sizeof (fullpath), "%s/%s",
|
||||||
|
dirpath, ent->d_name) >= sizeof (fullpath)) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("internal error: "
|
||||||
|
"ZPOOL_SCRIPTS_PATH too large.\n"));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Print the scripts */
|
/* Print the scripts */
|
||||||
if (stat(fullpath, &dir_stat) == 0)
|
if (stat(fullpath, &dir_stat) == 0)
|
||||||
|
|||||||
+35
-36
@@ -97,23 +97,13 @@ AC_DEFUN([AX_PYTHON_DEVEL],[
|
|||||||
# Check for a version of Python >= 2.1.0
|
# Check for a version of Python >= 2.1.0
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
|
||||||
ac_supports_python_ver=`cat<<EOD | $PYTHON -
|
ac_supports_python_ver=`$PYTHON -c "import sys; \
|
||||||
from __future__ import print_function;
|
ver = sys.version.split ()[[0]]; \
|
||||||
import sys;
|
print (ver >= '2.1.0')"`
|
||||||
try:
|
|
||||||
from packaging import version;
|
|
||||||
except ImportError:
|
|
||||||
from distlib import version;
|
|
||||||
ver = sys.version.split ()[[0]];
|
|
||||||
(tst_cmp, tst_ver) = ">= '2.1.0'".split ();
|
|
||||||
tst_ver = tst_ver.strip ("'");
|
|
||||||
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
|
|
||||||
EOD`
|
|
||||||
if test "$ac_supports_python_ver" != "True"; then
|
if test "$ac_supports_python_ver" != "True"; then
|
||||||
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
m4_ifvaln([$2],[$2],[
|
AC_MSG_FAILURE([
|
||||||
AC_MSG_FAILURE([
|
|
||||||
This version of the AC@&t@_PYTHON_DEVEL macro
|
This version of the AC@&t@_PYTHON_DEVEL macro
|
||||||
doesn't work properly with versions of Python before
|
doesn't work properly with versions of Python before
|
||||||
2.1.0. You may need to re-run configure, setting the
|
2.1.0. You may need to re-run configure, setting the
|
||||||
@@ -122,7 +112,6 @@ PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
|
|||||||
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
|
||||||
to something else than an empty string.
|
to something else than an empty string.
|
||||||
])
|
])
|
||||||
])
|
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([skip at user request])
|
AC_MSG_RESULT([skip at user request])
|
||||||
fi
|
fi
|
||||||
@@ -131,37 +120,47 @@ to something else than an empty string.
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# if the macro parameter ``version'' is set, honour it
|
# If the macro parameter ``version'' is set, honour it.
|
||||||
|
# A Python shim class, VPy, is used to implement correct version comparisons via
|
||||||
|
# string expressions, since e.g. a naive textual ">= 2.7.3" won't work for
|
||||||
|
# Python 2.7.10 (the ".1" being evaluated as less than ".3").
|
||||||
#
|
#
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
AC_MSG_CHECKING([for a version of Python $1])
|
AC_MSG_CHECKING([for a version of Python $1])
|
||||||
# Why the strip ()? Because if we don't, version.parse
|
cat << EOF > ax_python_devel_vpy.py
|
||||||
# will, for example, report 3.10.0 >= '3.11.0'
|
class VPy:
|
||||||
ac_supports_python_ver=`cat<<EOD | $PYTHON -
|
def vtup(self, s):
|
||||||
|
return tuple(map(int, s.strip().replace("rc", ".").split(".")))
|
||||||
from __future__ import print_function;
|
def __init__(self):
|
||||||
import sys;
|
import sys
|
||||||
try:
|
self.vpy = tuple(sys.version_info)
|
||||||
from packaging import version;
|
def __eq__(self, s):
|
||||||
except ImportError:
|
return self.vpy == self.vtup(s)
|
||||||
from distlib import version;
|
def __ne__(self, s):
|
||||||
ver = sys.version.split ()[[0]];
|
return self.vpy != self.vtup(s)
|
||||||
(tst_cmp, tst_ver) = "$1".split ();
|
def __lt__(self, s):
|
||||||
tst_ver = tst_ver.strip ("'");
|
return self.vpy < self.vtup(s)
|
||||||
eval ("print (version.LegacyVersion (ver)"+ tst_cmp +"version.LegacyVersion (tst_ver))")
|
def __gt__(self, s):
|
||||||
EOD`
|
return self.vpy > self.vtup(s)
|
||||||
|
def __le__(self, s):
|
||||||
|
return self.vpy <= self.vtup(s)
|
||||||
|
def __ge__(self, s):
|
||||||
|
return self.vpy >= self.vtup(s)
|
||||||
|
EOF
|
||||||
|
ac_supports_python_ver=`$PYTHON -c "import ax_python_devel_vpy; \
|
||||||
|
ver = ax_python_devel_vpy.VPy(); \
|
||||||
|
print (ver $1)"`
|
||||||
|
rm -rf ax_python_devel_vpy*.py* __pycache__/ax_python_devel_vpy*.py*
|
||||||
if test "$ac_supports_python_ver" = "True"; then
|
if test "$ac_supports_python_ver" = "True"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
m4_ifvaln([$2],[$2],[
|
AC_MSG_ERROR([this package requires Python $1.
|
||||||
AC_MSG_ERROR([this package requires Python $1.
|
|
||||||
If you have it installed, but it isn't the default Python
|
If you have it installed, but it isn't the default Python
|
||||||
interpreter in your system path, please pass the PYTHON_VERSION
|
interpreter in your system path, please pass the PYTHON_VERSION
|
||||||
variable to configure. See ``configure --help'' for reference.
|
variable to configure. See ``configure --help'' for reference.
|
||||||
])
|
])
|
||||||
PYTHON_VERSION=""
|
PYTHON_VERSION=""
|
||||||
])
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -66,7 +66,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## to do this, so we install a shim onto the path which calls the real
|
## to do this, so we install a shim onto the path which calls the real
|
||||||
## dh_shlibdeps with the required arguments.
|
## dh_shlibdeps with the required arguments.
|
||||||
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
||||||
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#!$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs5linux -xlibzpool5linux" \
|
||||||
>> $${path_prepend}/dh_shlibdeps; \
|
>> $${path_prepend}/dh_shlibdeps; \
|
||||||
@@ -74,7 +74,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## Debianized packages from the auto-generated dependencies of the new debs,
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
||||||
## which should NOT be mixed with the alien-generated debs created here
|
## which should NOT be mixed with the alien-generated debs created here
|
||||||
chmod +x $${path_prepend}/dh_shlibdeps; \
|
chmod +x $${path_prepend}/dh_shlibdeps; \
|
||||||
env PATH=$${path_prepend}:$${PATH} \
|
env "PATH=$${path_prepend}:$${PATH}" \
|
||||||
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch \
|
||||||
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
$$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
|
||||||
$$pkg8 $$pkg9 $$pkg10 || exit 1; \
|
$$pkg8 $$pkg9 $$pkg10 || exit 1; \
|
||||||
|
|||||||
+46
-4
@@ -165,6 +165,9 @@ dnl #
|
|||||||
dnl # 5.15 API change,
|
dnl # 5.15 API change,
|
||||||
dnl # Added the bool rcu argument to get_acl for rcu path walk.
|
dnl # Added the bool rcu argument to get_acl for rcu path walk.
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl # 6.2 API change,
|
||||||
|
dnl # get_acl() was renamed to get_inode_acl()
|
||||||
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
|
ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
@@ -189,6 +192,18 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
|||||||
.get_acl = get_acl_fn,
|
.get_acl = get_acl_fn,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
|
||||||
|
bool rcu) { return NULL; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.get_inode_acl = get_inode_acl_fn,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
||||||
@@ -201,7 +216,12 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
|
AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([iops->get_acl()])
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_inode_acl], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GET_INODE_ACL, 1, [has iops->get_inode_acl()])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([iops->get_acl() or iops->get_inode_acl()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -213,7 +233,22 @@ dnl #
|
|||||||
dnl # 5.12 API change,
|
dnl # 5.12 API change,
|
||||||
dnl # set_acl() added a user_namespace* parameter first
|
dnl # set_acl() added a user_namespace* parameter first
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl # 6.2 API change,
|
||||||
|
dnl # set_acl() second paramter changed to a struct dentry *
|
||||||
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
int set_acl_fn(struct user_namespace *userns,
|
||||||
|
struct dentry *dent, struct posix_acl *acl,
|
||||||
|
int type) { return 0; }
|
||||||
|
|
||||||
|
static const struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.set_acl = set_acl_fn,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
@@ -246,11 +281,18 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
|||||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||||
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||||
|
AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
|
||||||
|
[iops->set_acl() takes 4 args, arg2 is struct dentry *])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||||
AS_IF([AC_TRY_COMMAND(
|
AS_IF([AC_TRY_COMMAND(
|
||||||
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | egrep -qx $1)],[
|
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||||
[enum $2 contains $1])
|
[enum $2 contains $1])
|
||||||
|
|||||||
@@ -3,11 +3,25 @@ dnl # 3.11 API change
|
|||||||
dnl # Add support for i_op->tmpfile
|
dnl # Add support for i_op->tmpfile
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
||||||
|
dnl #
|
||||||
|
dnl # 6.1 API change
|
||||||
|
dnl # use struct file instead of struct dentry
|
||||||
|
dnl #
|
||||||
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
int tmpfile(struct user_namespace *userns,
|
||||||
|
struct inode *inode, struct file *file,
|
||||||
|
umode_t mode) { return 0; }
|
||||||
|
static struct inode_operations
|
||||||
|
iops __attribute__ ((unused)) = {
|
||||||
|
.tmpfile = tmpfile,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 5.11 API change
|
dnl # 5.11 API change
|
||||||
dnl # add support for userns parameter to tmpfile
|
dnl # add support for userns parameter to tmpfile
|
||||||
dnl #
|
dnl #
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_userns], [
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry_userns], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int tmpfile(struct user_namespace *userns,
|
int tmpfile(struct user_namespace *userns,
|
||||||
struct inode *inode, struct dentry *dentry,
|
struct inode *inode, struct dentry *dentry,
|
||||||
@@ -17,7 +31,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
|||||||
.tmpfile = tmpfile,
|
.tmpfile = tmpfile,
|
||||||
};
|
};
|
||||||
],[])
|
],[])
|
||||||
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
|
ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
int tmpfile(struct inode *inode, struct dentry *dentry,
|
int tmpfile(struct inode *inode, struct dentry *dentry,
|
||||||
umode_t mode) { return 0; }
|
umode_t mode) { return 0; }
|
||||||
@@ -30,16 +44,24 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
||||||
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_userns], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||||
|
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
+35
-3
@@ -404,11 +404,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
utsrelease1=$kernelbuild/include/linux/version.h
|
utsrelease1=$kernelbuild/include/linux/version.h
|
||||||
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
||||||
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
||||||
AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
|
AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
|
||||||
utsrelease=$utsrelease1
|
utsrelease=$utsrelease1
|
||||||
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
|
||||||
utsrelease=$utsrelease2
|
utsrelease=$utsrelease2
|
||||||
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
|
||||||
utsrelease=$utsrelease3
|
utsrelease=$utsrelease3
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -946,3 +946,35 @@ AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
|||||||
[test -f build/conftest/conftest.ko], [$3], [$4], [$5])
|
[test -f build/conftest/conftest.ko], [$3], [$4], [$5])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # AS_VERSION_COMPARE_LE
|
||||||
|
dnl # like AS_VERSION_COMPARE_LE, but runs $3 if (and only if) $1 <= $2
|
||||||
|
dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater])
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([AS_VERSION_COMPARE_LE], [
|
||||||
|
AS_VERSION_COMPARE([$1], [$2], [$3], [$3], [$4])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # ZFS_LINUX_REQUIRE_API
|
||||||
|
dnl # like ZFS_LINUX_TEST_ERROR, except only fails if the kernel is
|
||||||
|
dnl # at least some specified version.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_LINUX_REQUIRE_API], [
|
||||||
|
AS_VERSION_COMPARE_LE([$2], [$kernsrcver], [
|
||||||
|
AC_MSG_ERROR([
|
||||||
|
*** None of the expected "$1" interfaces were detected. This
|
||||||
|
*** interface is expected for kernels version "$2" and above.
|
||||||
|
*** This may be because your kernel version is newer than what is
|
||||||
|
*** supported, or you are using a patched custom kernel with
|
||||||
|
*** incompatible modifications. Newer kernels may have incompatible
|
||||||
|
*** APIs.
|
||||||
|
***
|
||||||
|
*** ZFS Version: $ZFS_META_ALIAS
|
||||||
|
*** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
|
||||||
|
])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|||||||
+1
-1
@@ -173,7 +173,7 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
|
||||||
AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
|
AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
|
||||||
[enable_invariants="yes"],
|
[enable_invariants="yes"],
|
||||||
[enable_invariants="no"])
|
[enable_invariants="no"])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ array_contains () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
|
# https://github.com/dracutdevs/dracut/pull/1711 provides a zfs_devs
|
||||||
|
# function to detect the physical devices backing zfs pools. If this
|
||||||
|
# function exists in the version of dracut this module is being called
|
||||||
|
# from, then it does not need to run.
|
||||||
|
type zfs_devs >/dev/null 2>&1 && return 1
|
||||||
|
|
||||||
local mp
|
local mp
|
||||||
local dev
|
local dev
|
||||||
local blockdevs
|
local blockdevs
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ install() {
|
|||||||
"zfs-import-cache.service"; do
|
"zfs-import-cache.service"; do
|
||||||
inst_simple "${systemdsystemunitdir}/${_service}"
|
inst_simple "${systemdsystemunitdir}/${_service}"
|
||||||
systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
|
systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
|
||||||
|
|
||||||
|
# Add user-provided unit overrides
|
||||||
|
# - /etc/systemd/system/zfs-import-{scan,cache}.service
|
||||||
|
# - /etc/systemd/system/zfs-import-{scan,cache}.service.d/overrides.conf
|
||||||
|
# -H ensures they are marked host-only
|
||||||
|
# -o ensures there is no error upon absence of these files
|
||||||
|
inst_multiple -o -H \
|
||||||
|
"${systemdsystemconfdir}/${_service}" \
|
||||||
|
"${systemdsystemconfdir}/${_service}.d/"*.conf
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
for _service in \
|
for _service in \
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ZFS_DATASET="${ZFS_DATASET:-${root}}"
|
|||||||
ZFS_POOL="${ZFS_DATASET%%/*}"
|
ZFS_POOL="${ZFS_DATASET%%/*}"
|
||||||
|
|
||||||
|
|
||||||
if ! zpool get -Ho name "${ZFS_POOL}" > /dev/null 2>&1; then
|
if ! zpool get -Ho value name "${ZFS_POOL}" > /dev/null 2>&1; then
|
||||||
info "ZFS: Importing pool ${ZFS_POOL}..."
|
info "ZFS: Importing pool ${ZFS_POOL}..."
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then
|
if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then
|
||||||
|
|||||||
@@ -331,25 +331,21 @@ mount_fs()
|
|||||||
# Can't use the mountpoint property. Might be one of our
|
# Can't use the mountpoint property. Might be one of our
|
||||||
# clones. Check the 'org.zol:mountpoint' property set in
|
# clones. Check the 'org.zol:mountpoint' property set in
|
||||||
# clone_snap() if that's usable.
|
# clone_snap() if that's usable.
|
||||||
mountpoint=$(get_fs_value "$fs" org.zol:mountpoint)
|
mountpoint1=$(get_fs_value "$fs" org.zol:mountpoint)
|
||||||
if [ "$mountpoint" = "legacy" ] ||
|
if [ "$mountpoint1" = "legacy" ] ||
|
||||||
[ "$mountpoint" = "none" ] ||
|
[ "$mountpoint1" = "none" ] ||
|
||||||
[ "$mountpoint" = "-" ]
|
[ "$mountpoint1" = "-" ]
|
||||||
then
|
then
|
||||||
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
||||||
# We don't have a proper mountpoint and this
|
# We don't have a proper mountpoint and this
|
||||||
# isn't the root fs.
|
# isn't the root fs.
|
||||||
return 0
|
return 0
|
||||||
else
|
|
||||||
# Last hail-mary: Hope 'rootmnt' is set!
|
|
||||||
mountpoint=""
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# If it's not a legacy filesystem, it can only be a
|
|
||||||
# native one...
|
|
||||||
if [ "$mountpoint" = "legacy" ]; then
|
|
||||||
ZFS_CMD="mount.zfs"
|
ZFS_CMD="mount.zfs"
|
||||||
|
# Last hail-mary: Hope 'rootmnt' is set!
|
||||||
|
mountpoint=""
|
||||||
|
else
|
||||||
|
mountpoint="$mountpoint1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -503,7 +499,7 @@ clone_snap()
|
|||||||
echo "Error: $ZFS_ERROR"
|
echo "Error: $ZFS_ERROR"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Failed to clone snapshot."
|
echo "Failed to clone snapshot."
|
||||||
echo "Make sure that the any problems are corrected and then make sure"
|
echo "Make sure that any problems are corrected and then make sure"
|
||||||
echo "that the dataset '$destfs' exists and is bootable."
|
echo "that the dataset '$destfs' exists and is bootable."
|
||||||
shell
|
shell
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@sbindir@/zed -F
|
ExecStart=@sbindir@/zed -F
|
||||||
Restart=on-abort
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
Alias=zed.service
|
Alias=zed.service
|
||||||
|
|||||||
+4
-2
@@ -151,13 +151,15 @@ int zfs_ioctl_fd(int fd, unsigned long request, struct zfs_cmd *zc);
|
|||||||
* List of colors to use
|
* List of colors to use
|
||||||
*/
|
*/
|
||||||
#define ANSI_RED "\033[0;31m"
|
#define ANSI_RED "\033[0;31m"
|
||||||
|
#define ANSI_GREEN "\033[0;32m"
|
||||||
#define ANSI_YELLOW "\033[0;33m"
|
#define ANSI_YELLOW "\033[0;33m"
|
||||||
|
#define ANSI_BLUE "\033[0;34m"
|
||||||
#define ANSI_RESET "\033[0m"
|
#define ANSI_RESET "\033[0m"
|
||||||
#define ANSI_BOLD "\033[1m"
|
#define ANSI_BOLD "\033[1m"
|
||||||
|
|
||||||
void color_start(char *color);
|
void color_start(const char *color);
|
||||||
void color_end(void);
|
void color_end(void);
|
||||||
int printf_color(char *color, char *format, ...);
|
int printf_color(const char *color, char *format, ...);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These functions are used by the ZFS libraries and cmd/zpool code, but are
|
* These functions are used by the ZFS libraries and cmd/zpool code, but are
|
||||||
|
|||||||
@@ -357,7 +357,11 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
|||||||
static inline void
|
static inline void
|
||||||
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_BIO_BI_OPF)
|
||||||
|
bio->bi_opf = rw | flags;
|
||||||
|
#else
|
||||||
bio->bi_rw |= rw | flags;
|
bio->bi_rw |= rw | flags;
|
||||||
|
#endif /* HAVE_BIO_BI_OPF */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
#define d_make_root(inode) d_alloc_root(inode)
|
#define d_make_root(inode) d_alloc_root(inode)
|
||||||
#endif /* HAVE_D_MAKE_ROOT */
|
#endif /* HAVE_D_MAKE_ROOT */
|
||||||
|
|
||||||
|
#ifdef HAVE_DENTRY_D_U_ALIASES
|
||||||
|
#define d_alias d_u.d_alias
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2.6.30 API change,
|
* 2.6.30 API change,
|
||||||
* The const keyword was added to the 'struct dentry_operations' in
|
* The const keyword was added to the 'struct dentry_operations' in
|
||||||
@@ -70,11 +74,7 @@ zpl_d_drop_aliases(struct inode *inode)
|
|||||||
{
|
{
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
#ifdef HAVE_DENTRY_D_U_ALIASES
|
|
||||||
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
|
|
||||||
#else
|
|
||||||
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
||||||
#endif
|
|
||||||
if (!IS_ROOT(dentry) && !d_mountpoint(dentry) &&
|
if (!IS_ROOT(dentry) && !d_mountpoint(dentry) &&
|
||||||
(dentry->d_inode == inode)) {
|
(dentry->d_inode == inode)) {
|
||||||
d_drop(dentry);
|
d_drop(dentry);
|
||||||
|
|||||||
@@ -67,11 +67,14 @@ extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
|
|||||||
#if defined(HAVE_SET_ACL_USERNS)
|
#if defined(HAVE_SET_ACL_USERNS)
|
||||||
extern int zpl_set_acl(struct user_namespace *userns, struct inode *ip,
|
extern int zpl_set_acl(struct user_namespace *userns, struct inode *ip,
|
||||||
struct posix_acl *acl, int type);
|
struct posix_acl *acl, int type);
|
||||||
|
#elif defined(HAVE_SET_ACL_USERNS_DENTRY_ARG2)
|
||||||
|
extern int zpl_set_acl(struct user_namespace *userns, struct dentry *dentry,
|
||||||
|
struct posix_acl *acl, int type);
|
||||||
#else
|
#else
|
||||||
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
|
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
|
||||||
#endif /* HAVE_SET_ACL_USERNS */
|
#endif /* HAVE_SET_ACL_USERNS */
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
#if defined(HAVE_GET_ACL_RCU)
|
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
|
||||||
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
|
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
|
||||||
#elif defined(HAVE_GET_ACL)
|
#elif defined(HAVE_GET_ACL)
|
||||||
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
|
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
|
||||||
|
|||||||
+66
-49
@@ -45,16 +45,21 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/zfs_ioctl.h>
|
#include <sys/zfs_ioctl.h>
|
||||||
#include <libzfs.h>
|
#include <libzfs.h>
|
||||||
|
#include <libzutil.h>
|
||||||
#include "libzfs_impl.h"
|
#include "libzfs_impl.h"
|
||||||
|
|
||||||
#define ZDIFF_SNAPDIR "/.zfs/snapshot/"
|
#define ZDIFF_SNAPDIR "/.zfs/snapshot/"
|
||||||
#define ZDIFF_PREFIX "zfs-diff-%d"
|
#define ZDIFF_PREFIX "zfs-diff-%d"
|
||||||
|
|
||||||
#define ZDIFF_ADDED '+'
|
#define ZDIFF_ADDED '+'
|
||||||
#define ZDIFF_MODIFIED 'M'
|
#define ZDIFF_MODIFIED "M"
|
||||||
#define ZDIFF_REMOVED '-'
|
#define ZDIFF_REMOVED '-'
|
||||||
#define ZDIFF_RENAMED 'R'
|
#define ZDIFF_RENAMED "R"
|
||||||
|
|
||||||
|
#define ZDIFF_ADDED_COLOR ANSI_GREEN
|
||||||
|
#define ZDIFF_MODIFIED_COLOR ANSI_YELLOW
|
||||||
|
#define ZDIFF_REMOVED_COLOR ANSI_RED
|
||||||
|
#define ZDIFF_RENAMED_COLOR ANSI_BLUE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a {dsname, object id}, get the object path
|
* Given a {dsname, object id}, get the object path
|
||||||
@@ -129,48 +134,54 @@ stream_bytes(FILE *fp, const char *string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*
|
||||||
print_what(FILE *fp, mode_t what)
|
* Takes the type of change (like `print_file`), outputs the appropriate color
|
||||||
|
*/
|
||||||
|
static const char *
|
||||||
|
type_to_color(char type)
|
||||||
{
|
{
|
||||||
char symbol;
|
if (type == '+')
|
||||||
|
return (ZDIFF_ADDED_COLOR);
|
||||||
|
else if (type == '-')
|
||||||
|
return (ZDIFF_REMOVED_COLOR);
|
||||||
|
else if (type == 'M')
|
||||||
|
return (ZDIFF_MODIFIED_COLOR);
|
||||||
|
else if (type == 'R')
|
||||||
|
return (ZDIFF_RENAMED_COLOR);
|
||||||
|
else
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static char
|
||||||
|
get_what(mode_t what)
|
||||||
|
{
|
||||||
switch (what & S_IFMT) {
|
switch (what & S_IFMT) {
|
||||||
case S_IFBLK:
|
case S_IFBLK:
|
||||||
symbol = 'B';
|
return ('B');
|
||||||
break;
|
|
||||||
case S_IFCHR:
|
case S_IFCHR:
|
||||||
symbol = 'C';
|
return ('C');
|
||||||
break;
|
|
||||||
case S_IFDIR:
|
case S_IFDIR:
|
||||||
symbol = '/';
|
return ('/');
|
||||||
break;
|
|
||||||
#ifdef S_IFDOOR
|
#ifdef S_IFDOOR
|
||||||
case S_IFDOOR:
|
case S_IFDOOR:
|
||||||
symbol = '>';
|
return ('>');
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
case S_IFIFO:
|
case S_IFIFO:
|
||||||
symbol = '|';
|
return ('|');
|
||||||
break;
|
|
||||||
case S_IFLNK:
|
case S_IFLNK:
|
||||||
symbol = '@';
|
return ('@');
|
||||||
break;
|
|
||||||
#ifdef S_IFPORT
|
#ifdef S_IFPORT
|
||||||
case S_IFPORT:
|
case S_IFPORT:
|
||||||
symbol = 'P';
|
return ('P');
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
case S_IFSOCK:
|
case S_IFSOCK:
|
||||||
symbol = '=';
|
return ('=');
|
||||||
break;
|
|
||||||
case S_IFREG:
|
case S_IFREG:
|
||||||
symbol = 'F';
|
return ('F');
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
symbol = '?';
|
return ('?');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
(void) fprintf(fp, "%c", symbol);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -189,57 +200,63 @@ static void
|
|||||||
print_rename(FILE *fp, differ_info_t *di, const char *old, const char *new,
|
print_rename(FILE *fp, differ_info_t *di, const char *old, const char *new,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(ZDIFF_RENAMED_COLOR);
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", ZDIFF_RENAMED);
|
(void) fputs(ZDIFF_RENAMED "\t", fp);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, old);
|
print_cmn(fp, di, old);
|
||||||
if (di->scripted)
|
(void) fputs(di->scripted ? "\t" : " -> ", fp);
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
else
|
|
||||||
(void) fprintf(fp, " -> ");
|
|
||||||
print_cmn(fp, di, new);
|
print_cmn(fp, di, new);
|
||||||
(void) fprintf(fp, "\n");
|
(void) fputc('\n', fp);
|
||||||
|
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_link_change(FILE *fp, differ_info_t *di, int delta, const char *file,
|
print_link_change(FILE *fp, differ_info_t *di, int delta, const char *file,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(ZDIFF_MODIFIED_COLOR);
|
||||||
|
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", ZDIFF_MODIFIED);
|
(void) fputs(ZDIFF_MODIFIED "\t", fp);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, file);
|
print_cmn(fp, di, file);
|
||||||
(void) fprintf(fp, "\t(%+d)", delta);
|
(void) fprintf(fp, "\t(%+d)\n", delta);
|
||||||
(void) fprintf(fp, "\n");
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_file(FILE *fp, differ_info_t *di, char type, const char *file,
|
print_file(FILE *fp, differ_info_t *di, char type, const char *file,
|
||||||
zfs_stat_t *isb)
|
zfs_stat_t *isb)
|
||||||
{
|
{
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_start(type_to_color(type));
|
||||||
|
|
||||||
if (di->timestamped)
|
if (di->timestamped)
|
||||||
(void) fprintf(fp, "%10lld.%09lld\t",
|
(void) fprintf(fp, "%10lld.%09lld\t",
|
||||||
(longlong_t)isb->zs_ctime[0],
|
(longlong_t)isb->zs_ctime[0],
|
||||||
(longlong_t)isb->zs_ctime[1]);
|
(longlong_t)isb->zs_ctime[1]);
|
||||||
(void) fprintf(fp, "%c\t", type);
|
(void) fprintf(fp, "%c\t", type);
|
||||||
if (di->classify) {
|
if (di->classify)
|
||||||
print_what(fp, isb->zs_mode);
|
(void) fprintf(fp, "%c\t", get_what(isb->zs_mode));
|
||||||
(void) fprintf(fp, "\t");
|
|
||||||
}
|
|
||||||
print_cmn(fp, di, file);
|
print_cmn(fp, di, file);
|
||||||
(void) fprintf(fp, "\n");
|
(void) fputc('\n', fp);
|
||||||
|
|
||||||
|
if (isatty(fileno(fp)))
|
||||||
|
color_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -332,7 +349,7 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
|
|||||||
print_link_change(fp, di, change,
|
print_link_change(fp, di, change,
|
||||||
change > 0 ? fobjname : tobjname, &tsb);
|
change > 0 ? fobjname : tobjname, &tsb);
|
||||||
} else if (strcmp(fobjname, tobjname) == 0) {
|
} else if (strcmp(fobjname, tobjname) == 0) {
|
||||||
print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb);
|
print_file(fp, di, *ZDIFF_MODIFIED, fobjname, &tsb);
|
||||||
} else {
|
} else {
|
||||||
print_rename(fp, di, fobjname, tobjname, &tsb);
|
print_rename(fp, di, fobjname, tobjname, &tsb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3966,6 +3966,15 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For plain replicated send, we can ignore encryption
|
||||||
|
* properties other than first stream
|
||||||
|
*/
|
||||||
|
if ((zfs_prop_encryption_key_param(prop) || prop ==
|
||||||
|
ZFS_PROP_ENCRYPTION) && !newfs && recursive && !raw) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* incremental streams can only exclude encryption properties */
|
/* incremental streams can only exclude encryption properties */
|
||||||
if ((zfs_prop_encryption_key_param(prop) ||
|
if ((zfs_prop_encryption_key_param(prop) ||
|
||||||
prop == ZFS_PROP_ENCRYPTION) && !newfs &&
|
prop == ZFS_PROP_ENCRYPTION) && !newfs &&
|
||||||
@@ -4065,7 +4074,8 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type,
|
|||||||
if (cp != NULL)
|
if (cp != NULL)
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
if (!raw && zfs_crypto_create(hdl, namebuf, voprops, NULL,
|
if (!raw && !(!newfs && recursive) &&
|
||||||
|
zfs_crypto_create(hdl, namebuf, voprops, NULL,
|
||||||
B_FALSE, wkeydata_out, wkeylen_out) != 0) {
|
B_FALSE, wkeydata_out, wkeylen_out) != 0) {
|
||||||
fnvlist_free(voprops);
|
fnvlist_free(voprops);
|
||||||
ret = zfs_error(hdl, EZFS_CRYPTOFAILED, errbuf);
|
ret = zfs_error(hdl, EZFS_CRYPTOFAILED, errbuf);
|
||||||
|
|||||||
@@ -2082,22 +2082,26 @@ use_color(void)
|
|||||||
* color_end();
|
* color_end();
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
color_start(char *color)
|
color_start(const char *color)
|
||||||
{
|
{
|
||||||
if (use_color())
|
if (use_color()) {
|
||||||
printf("%s", color);
|
fputs(color, stdout);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
color_end(void)
|
color_end(void)
|
||||||
{
|
{
|
||||||
if (use_color())
|
if (use_color()) {
|
||||||
printf(ANSI_RESET);
|
fputs(ANSI_RESET, stdout);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf() with a color. If color is NULL, then do a normal printf. */
|
/* printf() with a color. If color is NULL, then do a normal printf. */
|
||||||
int
|
int
|
||||||
printf_color(char *color, char *format, ...)
|
printf_color(const char *color, char *format, ...)
|
||||||
{
|
{
|
||||||
va_list aptr;
|
va_list aptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|||||||
@@ -35,6 +35,22 @@
|
|||||||
void
|
void
|
||||||
libzfs_set_pipe_max(int infd)
|
libzfs_set_pipe_max(int infd)
|
||||||
{
|
{
|
||||||
|
#if __linux__
|
||||||
|
/*
|
||||||
|
* Sadly, Linux has an unfixed deadlock if you do SETPIPE_SZ on a pipe
|
||||||
|
* with data in it.
|
||||||
|
* cf. #13232, https://bugzilla.kernel.org/show_bug.cgi?id=212295
|
||||||
|
*
|
||||||
|
* And since the problem is in waking up the writer, there's nothing
|
||||||
|
* we can do about it from here.
|
||||||
|
*
|
||||||
|
* So if people want to, they can set this, but they
|
||||||
|
* may regret it...
|
||||||
|
*/
|
||||||
|
if (getenv("ZFS_SET_PIPE_MAX") == NULL)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "re");
|
FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "re");
|
||||||
|
|
||||||
if (procf != NULL) {
|
if (procf != NULL) {
|
||||||
|
|||||||
@@ -704,6 +704,12 @@ command will be undone if the share is ever unshared (like via a reboot).
|
|||||||
.El
|
.El
|
||||||
.
|
.
|
||||||
.Sh ENVIRONMENT VARIABLES
|
.Sh ENVIRONMENT VARIABLES
|
||||||
|
.Bl -tag -width "ZFS_COLOR"
|
||||||
|
.It Sy ZFS_COLOR
|
||||||
|
Use ANSI color in
|
||||||
|
.Nm zfs Cm diff
|
||||||
|
output.
|
||||||
|
.El
|
||||||
.Bl -tag -width "ZFS_MOUNT_HELPER"
|
.Bl -tag -width "ZFS_MOUNT_HELPER"
|
||||||
.It Sy ZFS_MOUNT_HELPER
|
.It Sy ZFS_MOUNT_HELPER
|
||||||
Cause
|
Cause
|
||||||
@@ -713,6 +719,14 @@ to use
|
|||||||
to mount ZFS datasets.
|
to mount ZFS datasets.
|
||||||
This option is provided for backwards compatibility with older ZFS versions.
|
This option is provided for backwards compatibility with older ZFS versions.
|
||||||
.El
|
.El
|
||||||
|
.Bl -tag -width "ZFS_SET_PIPE_MAX"
|
||||||
|
.It Sy ZFS_SET_PIPE_MAX
|
||||||
|
Tells
|
||||||
|
.Nm zfs
|
||||||
|
to set the maximum pipe size for sends/recieves.
|
||||||
|
Disabled by default on Linux
|
||||||
|
due to an unfixed deadlock in Linux's pipe size handling code.
|
||||||
|
.El
|
||||||
.
|
.
|
||||||
.Sh INTERFACE STABILITY
|
.Sh INTERFACE STABILITY
|
||||||
.Sy Committed .
|
.Sy Committed .
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <sys/kstat.h>
|
#include <sys/kstat.h>
|
||||||
#include <sys/sbuf.h>
|
#include <sys/sbuf.h>
|
||||||
|
#include <sys/zone.h>
|
||||||
|
|
||||||
static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
|
static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
|
||||||
|
|
||||||
@@ -134,6 +135,55 @@ kstat_sysctl_string(SYSCTL_HANDLER_ARGS)
|
|||||||
return (sysctl_handle_string(oidp, val, len, req));
|
return (sysctl_handle_string(oidp, val, len, req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
kstat_sysctl_dataset(SYSCTL_HANDLER_ARGS)
|
||||||
|
{
|
||||||
|
kstat_t *ksp = arg1;
|
||||||
|
kstat_named_t *ksent;
|
||||||
|
kstat_named_t *ksent_ds;
|
||||||
|
uint64_t val;
|
||||||
|
char *ds_name;
|
||||||
|
uint32_t ds_len = 0;
|
||||||
|
|
||||||
|
ksent_ds = ksent = ksp->ks_data;
|
||||||
|
ds_name = KSTAT_NAMED_STR_PTR(ksent_ds);
|
||||||
|
ds_len = KSTAT_NAMED_STR_BUFLEN(ksent_ds);
|
||||||
|
ds_name[ds_len-1] = '\0';
|
||||||
|
|
||||||
|
if (!zone_dataset_visible(ds_name, NULL)) {
|
||||||
|
return (EPERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Select the correct element */
|
||||||
|
ksent += arg2;
|
||||||
|
/* Update the aggsums before reading */
|
||||||
|
(void) ksp->ks_update(ksp, KSTAT_READ);
|
||||||
|
val = ksent->value.ui64;
|
||||||
|
|
||||||
|
return (sysctl_handle_64(oidp, &val, 0, req));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
kstat_sysctl_dataset_string(SYSCTL_HANDLER_ARGS)
|
||||||
|
{
|
||||||
|
kstat_t *ksp = arg1;
|
||||||
|
kstat_named_t *ksent = ksp->ks_data;
|
||||||
|
char *val;
|
||||||
|
uint32_t len = 0;
|
||||||
|
|
||||||
|
/* Select the correct element */
|
||||||
|
ksent += arg2;
|
||||||
|
val = KSTAT_NAMED_STR_PTR(ksent);
|
||||||
|
len = KSTAT_NAMED_STR_BUFLEN(ksent);
|
||||||
|
val[len-1] = '\0';
|
||||||
|
|
||||||
|
if (!zone_dataset_visible(val, NULL)) {
|
||||||
|
return (EPERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (sysctl_handle_string(oidp, val, len, req));
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
kstat_sysctl_io(SYSCTL_HANDLER_ARGS)
|
kstat_sysctl_io(SYSCTL_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
@@ -422,11 +472,20 @@ kstat_install_named(kstat_t *ksp)
|
|||||||
ksp, i, kstat_sysctl, "Q", namelast);
|
ksp, i, kstat_sysctl, "Q", namelast);
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_UINT64:
|
case KSTAT_DATA_UINT64:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
if (strcmp(ksp->ks_class, "dataset") == 0) {
|
||||||
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
OID_AUTO, namelast,
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
OID_AUTO, namelast,
|
||||||
ksp, i, kstat_sysctl, "QU", namelast);
|
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_dataset, "QU",
|
||||||
|
namelast);
|
||||||
|
} else {
|
||||||
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
|
OID_AUTO, namelast,
|
||||||
|
CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl, "QU", namelast);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_LONG:
|
case KSTAT_DATA_LONG:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
@@ -443,11 +502,21 @@ kstat_install_named(kstat_t *ksp)
|
|||||||
ksp, i, kstat_sysctl, "LU", namelast);
|
ksp, i, kstat_sysctl, "LU", namelast);
|
||||||
break;
|
break;
|
||||||
case KSTAT_DATA_STRING:
|
case KSTAT_DATA_STRING:
|
||||||
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
if (strcmp(ksp->ks_class, "dataset") == 0) {
|
||||||
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
OID_AUTO, namelast,
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
|
OID_AUTO, namelast, CTLTYPE_STRING |
|
||||||
ksp, i, kstat_sysctl_string, "A", namelast);
|
CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_dataset_string, "A",
|
||||||
|
namelast);
|
||||||
|
} else {
|
||||||
|
SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
|
||||||
|
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
|
||||||
|
OID_AUTO, namelast, CTLTYPE_STRING |
|
||||||
|
CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||||
|
ksp, i, kstat_sysctl_string, "A",
|
||||||
|
namelast);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
panic("unsupported type: %d", typelast);
|
panic("unsupported type: %d", typelast);
|
||||||
|
|||||||
@@ -132,16 +132,13 @@ zfsdev_ioctl(struct cdev *dev, ulong_t zcmd, caddr_t arg, int flag,
|
|||||||
len = IOCPARM_LEN(zcmd);
|
len = IOCPARM_LEN(zcmd);
|
||||||
vecnum = zcmd & 0xff;
|
vecnum = zcmd & 0xff;
|
||||||
zp = (void *)arg;
|
zp = (void *)arg;
|
||||||
uaddr = (void *)zp->zfs_cmd;
|
|
||||||
error = 0;
|
error = 0;
|
||||||
zcl = NULL;
|
zcl = NULL;
|
||||||
|
|
||||||
if (len != sizeof (zfs_iocparm_t)) {
|
if (len != sizeof (zfs_iocparm_t))
|
||||||
printf("len %d vecnum: %d sizeof (zfs_cmd_t) %ju\n",
|
|
||||||
len, vecnum, (uintmax_t)sizeof (zfs_cmd_t));
|
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
|
||||||
|
|
||||||
|
uaddr = (void *)zp->zfs_cmd;
|
||||||
zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
|
zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
|
||||||
/*
|
/*
|
||||||
* Remap ioctl code for legacy user binaries
|
* Remap ioctl code for legacy user binaries
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ spa_generate_rootconf(const char *name)
|
|||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
uint64_t txg;
|
uint64_t txg;
|
||||||
|
|
||||||
|
if (configs[i] == NULL)
|
||||||
|
continue;
|
||||||
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG);
|
||||||
if (txg > best_txg) {
|
if (txg > best_txg) {
|
||||||
best_txg = txg;
|
best_txg = txg;
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ zfs_register_callbacks(vfs_t *vfsp)
|
|||||||
nbmand = B_FALSE;
|
nbmand = B_FALSE;
|
||||||
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) {
|
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) {
|
||||||
nbmand = B_TRUE;
|
nbmand = B_TRUE;
|
||||||
} else if ((error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand) != 0)) {
|
} else if ((error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand)) != 0) {
|
||||||
dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
|
dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -536,6 +536,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
|
|||||||
* Acquire vnode lock before making it available to the world.
|
* Acquire vnode lock before making it available to the world.
|
||||||
*/
|
*/
|
||||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||||
|
#if __FreeBSD_version >= 1400077
|
||||||
|
vn_set_state(vp, VSTATE_CONSTRUCTED);
|
||||||
|
#endif
|
||||||
VN_LOCK_AREC(vp);
|
VN_LOCK_AREC(vp);
|
||||||
if (vp->v_type != VFIFO)
|
if (vp->v_type != VFIFO)
|
||||||
VN_LOCK_ASHARE(vp);
|
VN_LOCK_ASHARE(vp);
|
||||||
|
|||||||
@@ -1066,9 +1066,6 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *vap, znode_t **xzpp, cred_t *cr)
|
|||||||
|
|
||||||
*xzpp = NULL;
|
*xzpp = NULL;
|
||||||
|
|
||||||
if ((error = zfs_zaccess(zp, ACE_WRITE_NAMED_ATTRS, 0, B_FALSE, cr)))
|
|
||||||
return (error);
|
|
||||||
|
|
||||||
if ((error = zfs_acl_ids_create(zp, IS_XATTR, vap, cr, NULL,
|
if ((error = zfs_acl_ids_create(zp, IS_XATTR, vap, cr, NULL,
|
||||||
&acl_ids)) != 0)
|
&acl_ids)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
|||||||
@@ -579,6 +579,7 @@ zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl,
|
|||||||
boolean_t fuid_dirtied;
|
boolean_t fuid_dirtied;
|
||||||
boolean_t have_acl = B_FALSE;
|
boolean_t have_acl = B_FALSE;
|
||||||
boolean_t waited = B_FALSE;
|
boolean_t waited = B_FALSE;
|
||||||
|
boolean_t skip_acl = (flag & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have an ephemeral id, ACL, or XVATTR then
|
* If we have an ephemeral id, ACL, or XVATTR then
|
||||||
@@ -651,7 +652,7 @@ top:
|
|||||||
* Create a new file object and update the directory
|
* Create a new file object and update the directory
|
||||||
* to reference it.
|
* to reference it.
|
||||||
*/
|
*/
|
||||||
if ((error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr))) {
|
if ((error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, skip_acl, cr))) {
|
||||||
if (have_acl)
|
if (have_acl)
|
||||||
zfs_acl_ids_free(&acl_ids);
|
zfs_acl_ids_free(&acl_ids);
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
@@ -224,12 +224,17 @@ zpl_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
|
|||||||
|
|
||||||
#ifdef HAVE_TMPFILE
|
#ifdef HAVE_TMPFILE
|
||||||
static int
|
static int
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
||||||
|
struct file *file, umode_t mode)
|
||||||
|
#else
|
||||||
#ifdef HAVE_TMPFILE_USERNS
|
#ifdef HAVE_TMPFILE_USERNS
|
||||||
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
zpl_tmpfile(struct user_namespace *userns, struct inode *dir,
|
||||||
struct dentry *dentry, umode_t mode)
|
struct dentry *dentry, umode_t mode)
|
||||||
#else
|
#else
|
||||||
zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
cred_t *cr = CRED();
|
cred_t *cr = CRED();
|
||||||
struct inode *ip;
|
struct inode *ip;
|
||||||
@@ -252,11 +257,21 @@ zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
/* d_tmpfile will do drop_nlink, so we should set it first */
|
/* d_tmpfile will do drop_nlink, so we should set it first */
|
||||||
set_nlink(ip, 1);
|
set_nlink(ip, 1);
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
d_tmpfile(file, ip);
|
||||||
|
|
||||||
|
error = zpl_xattr_security_init(ip, dir,
|
||||||
|
&file->f_path.dentry->d_name);
|
||||||
|
#else
|
||||||
d_tmpfile(dentry, ip);
|
d_tmpfile(dentry, ip);
|
||||||
|
|
||||||
error = zpl_xattr_security_init(ip, dir, &dentry->d_name);
|
error = zpl_xattr_security_init(ip, dir, &dentry->d_name);
|
||||||
|
#endif
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
error = zpl_init_acl(ip, dir);
|
error = zpl_init_acl(ip, dir);
|
||||||
|
#ifndef HAVE_TMPFILE_DENTRY
|
||||||
|
error = finish_open_simple(file, error);
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* don't need to handle error here, file is already in
|
* don't need to handle error here, file is already in
|
||||||
* unlinked set.
|
* unlinked set.
|
||||||
@@ -711,7 +726,11 @@ const struct inode_operations zpl_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -744,7 +763,11 @@ const struct inode_operations zpl_dir_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -783,6 +806,10 @@ const struct inode_operations zpl_special_inode_operations = {
|
|||||||
#if defined(HAVE_SET_ACL)
|
#if defined(HAVE_SET_ACL)
|
||||||
.set_acl = zpl_set_acl,
|
.set_acl = zpl_set_acl,
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
#if defined(HAVE_GET_INODE_ACL)
|
||||||
|
.get_inode_acl = zpl_get_acl,
|
||||||
|
#else
|
||||||
.get_acl = zpl_get_acl,
|
.get_acl = zpl_get_acl,
|
||||||
|
#endif /* HAVE_GET_INODE_ACL */
|
||||||
#endif /* CONFIG_FS_POSIX_ACL */
|
#endif /* CONFIG_FS_POSIX_ACL */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ zpl_xattr_set_dir(struct inode *ip, const char *name, const void *value,
|
|||||||
vap->va_gid = crgetgid(cr);
|
vap->va_gid = crgetgid(cr);
|
||||||
|
|
||||||
error = -zfs_create(dxzp, (char *)name, vap, 0, 0644, &xzp,
|
error = -zfs_create(dxzp, (char *)name, vap, 0, 0644, &xzp,
|
||||||
cr, 0, NULL);
|
cr, ATTR_NOACLCHECK, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -1004,11 +1004,18 @@ int
|
|||||||
#ifdef HAVE_SET_ACL_USERNS
|
#ifdef HAVE_SET_ACL_USERNS
|
||||||
zpl_set_acl(struct user_namespace *userns, struct inode *ip,
|
zpl_set_acl(struct user_namespace *userns, struct inode *ip,
|
||||||
struct posix_acl *acl, int type)
|
struct posix_acl *acl, int type)
|
||||||
|
#elif defined(HAVE_SET_ACL_USERNS_DENTRY_ARG2)
|
||||||
|
zpl_set_acl(struct user_namespace *userns, struct dentry *dentry,
|
||||||
|
struct posix_acl *acl, int type)
|
||||||
#else
|
#else
|
||||||
zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
|
zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
|
||||||
#endif /* HAVE_SET_ACL_USERNS */
|
#endif /* HAVE_SET_ACL_USERNS */
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SET_ACL_USERNS_DENTRY_ARG2
|
||||||
|
return (zpl_set_acl_impl(d_inode(dentry), acl, type));
|
||||||
|
#else
|
||||||
return (zpl_set_acl_impl(ip, acl, type));
|
return (zpl_set_acl_impl(ip, acl, type));
|
||||||
|
#endif /* HAVE_SET_ACL_USERNS_DENTRY_ARG2 */
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SET_ACL */
|
#endif /* HAVE_SET_ACL */
|
||||||
|
|
||||||
@@ -1067,7 +1074,7 @@ zpl_get_acl_impl(struct inode *ip, int type)
|
|||||||
return (acl);
|
return (acl);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_GET_ACL_RCU)
|
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
|
||||||
struct posix_acl *
|
struct posix_acl *
|
||||||
zpl_get_acl(struct inode *ip, int type, bool rcu)
|
zpl_get_acl(struct inode *ip, int type, bool rcu)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2022 MNX Cloud, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -213,10 +216,10 @@ const int8_t u8_number_of_bytes[0x100] = {
|
|||||||
/* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */
|
/* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
|
/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
|
/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
|
||||||
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
|
||||||
|
|
||||||
/* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */
|
/* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */
|
||||||
@@ -1286,8 +1289,12 @@ TRY_THE_NEXT_MARK:
|
|||||||
saved_l = l - disp[last];
|
saved_l = l - disp[last];
|
||||||
|
|
||||||
while (p < oslast) {
|
while (p < oslast) {
|
||||||
size = u8_number_of_bytes[*p];
|
int8_t number_of_bytes = u8_number_of_bytes[*p];
|
||||||
if (size <= 1 || (p + size) > oslast)
|
|
||||||
|
if (number_of_bytes <= 1)
|
||||||
|
break;
|
||||||
|
size = number_of_bytes;
|
||||||
|
if ((p + size) > oslast)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
saved_p = p;
|
saved_p = p;
|
||||||
@@ -1378,8 +1385,10 @@ SAFE_RETURN:
|
|||||||
*/
|
*/
|
||||||
static size_t
|
static size_t
|
||||||
collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast,
|
collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast,
|
||||||
boolean_t is_it_toupper, boolean_t is_it_tolower,
|
boolean_t is_it_toupper,
|
||||||
boolean_t canonical_decomposition, boolean_t compatibility_decomposition,
|
boolean_t is_it_tolower,
|
||||||
|
boolean_t canonical_decomposition,
|
||||||
|
boolean_t compatibility_decomposition,
|
||||||
boolean_t canonical_composition,
|
boolean_t canonical_composition,
|
||||||
int *errnum, u8_normalization_states_t *state)
|
int *errnum, u8_normalization_states_t *state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2408,13 +2408,6 @@ dmu_objset_id_quota_upgrade_cb(objset_t *os)
|
|||||||
dmu_objset_userobjspace_present(os))
|
dmu_objset_userobjspace_present(os))
|
||||||
return (SET_ERROR(ENOTSUP));
|
return (SET_ERROR(ENOTSUP));
|
||||||
|
|
||||||
if (dmu_objset_userobjused_enabled(os))
|
|
||||||
dmu_objset_ds(os)->ds_feature_activation[
|
|
||||||
SPA_FEATURE_USEROBJ_ACCOUNTING] = (void *)B_TRUE;
|
|
||||||
if (dmu_objset_projectquota_enabled(os))
|
|
||||||
dmu_objset_ds(os)->ds_feature_activation[
|
|
||||||
SPA_FEATURE_PROJECT_QUOTA] = (void *)B_TRUE;
|
|
||||||
|
|
||||||
err = dmu_objset_space_upgrade(os);
|
err = dmu_objset_space_upgrade(os);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|||||||
+10
-2
@@ -584,7 +584,13 @@ dump_write_embedded(dmu_send_cookie_t *dscp, uint64_t object, uint64_t offset,
|
|||||||
|
|
||||||
decode_embedded_bp_compressed(bp, buf);
|
decode_embedded_bp_compressed(bp, buf);
|
||||||
|
|
||||||
if (dump_record(dscp, buf, P2ROUNDUP(drrw->drr_psize, 8)) != 0)
|
uint32_t psize = drrw->drr_psize;
|
||||||
|
uint32_t rsize = P2ROUNDUP(psize, 8);
|
||||||
|
|
||||||
|
if (psize != rsize)
|
||||||
|
memset(buf + psize, 0, rsize - psize);
|
||||||
|
|
||||||
|
if (dump_record(dscp, buf, rsize) != 0)
|
||||||
return (SET_ERROR(EINTR));
|
return (SET_ERROR(EINTR));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -1714,8 +1720,10 @@ enqueue_range(struct send_reader_thread_arg *srta, bqueue_t *q, dnode_t *dn,
|
|||||||
struct send_range *range = range_alloc(range_type, dn->dn_object,
|
struct send_range *range = range_alloc(range_type, dn->dn_object,
|
||||||
blkid, blkid + count, B_FALSE);
|
blkid, blkid + count, B_FALSE);
|
||||||
|
|
||||||
if (blkid == DMU_SPILL_BLKID)
|
if (blkid == DMU_SPILL_BLKID) {
|
||||||
|
ASSERT3P(bp, !=, NULL);
|
||||||
ASSERT3U(BP_GET_TYPE(bp), ==, DMU_OT_SA);
|
ASSERT3U(BP_GET_TYPE(bp), ==, DMU_OT_SA);
|
||||||
|
}
|
||||||
|
|
||||||
switch (range_type) {
|
switch (range_type) {
|
||||||
case HOLE:
|
case HOLE:
|
||||||
|
|||||||
@@ -1749,16 +1749,20 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We are not allowed to dirty a filesystem when done receiving
|
* We are not allowed to dirty a filesystem when done receiving
|
||||||
* a snapshot. In this case the flag SPA_FEATURE_LARGE_BLOCKS will
|
* a snapshot. In this case some flags such as SPA_FEATURE_LARGE_BLOCKS
|
||||||
* not be set and a subsequent encrypted raw send will fail. Hence
|
* will not be set and a subsequent encrypted raw send will fail. Hence
|
||||||
* activate this feature if needed here.
|
* activate this feature if needed here. This needs to happen only in
|
||||||
|
* syncing context.
|
||||||
*/
|
*/
|
||||||
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
|
if (dmu_tx_is_syncing(tx)) {
|
||||||
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
|
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
|
||||||
!(zfeature_active(f, ds->ds_feature[f]))) {
|
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
|
||||||
dsl_dataset_activate_feature(dsobj, f,
|
!(zfeature_active(f, ds->ds_feature[f]))) {
|
||||||
ds->ds_feature_activation[f], tx);
|
dsl_dataset_activate_feature(dsobj, f,
|
||||||
ds->ds_feature[f] = ds->ds_feature_activation[f];
|
ds->ds_feature_activation[f], tx);
|
||||||
|
ds->ds_feature[f] =
|
||||||
|
ds->ds_feature_activation[f];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -4179,9 +4179,9 @@ vdev_clear(spa_t *spa, vdev_t *vd)
|
|||||||
vdev_clear(spa, vd->vdev_child[c]);
|
vdev_clear(spa, vd->vdev_child[c]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It makes no sense to "clear" an indirect vdev.
|
* It makes no sense to "clear" an indirect or removed vdev.
|
||||||
*/
|
*/
|
||||||
if (!vdev_is_concrete(vd))
|
if (!vdev_is_concrete(vd) || vd->vdev_removed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -210,9 +210,13 @@ DEFINE_GEN_METHODS(aarch64_neonx2);
|
|||||||
* If compiled with -O0, gcc doesn't do any stack frame coalescing
|
* If compiled with -O0, gcc doesn't do any stack frame coalescing
|
||||||
* and -Wframe-larger-than=1024 is triggered in debug mode.
|
* and -Wframe-larger-than=1024 is triggered in debug mode.
|
||||||
*/
|
*/
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic ignored "-Wframe-larger-than="
|
#pragma GCC diagnostic ignored "-Wframe-larger-than="
|
||||||
|
#endif
|
||||||
DEFINE_REC_METHODS(aarch64_neonx2);
|
DEFINE_REC_METHODS(aarch64_neonx2);
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
raidz_will_aarch64_neonx2_work(void)
|
raidz_will_aarch64_neonx2_work(void)
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/simd.h>
|
#include <sys/simd.h>
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
#define __asm __asm__ __volatile__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _REG_CNT(_0, _1, _2, _3, _4, _5, _6, _7, N, ...) N
|
#define _REG_CNT(_0, _1, _2, _3, _4, _5, _6, _7, N, ...) N
|
||||||
#define REG_CNT(r...) _REG_CNT(r, 8, 7, 6, 5, 4, 3, 2, 1)
|
#define REG_CNT(r...) _REG_CNT(r, 8, 7, 6, 5, 4, 3, 2, 1)
|
||||||
|
|
||||||
@@ -142,7 +138,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx 21,0,%[SRC0]\n" \
|
"lvx 21,0,%[SRC0]\n" \
|
||||||
"lvx 20,0,%[SRC1]\n" \
|
"lvx 20,0,%[SRC1]\n" \
|
||||||
"lvx 19,0,%[SRC2]\n" \
|
"lvx 19,0,%[SRC2]\n" \
|
||||||
@@ -172,7 +168,7 @@ typedef struct v {
|
|||||||
: "v18", "v19", "v20", "v21"); \
|
: "v18", "v19", "v20", "v21"); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx 21,0,%[SRC0]\n" \
|
"lvx 21,0,%[SRC0]\n" \
|
||||||
"lvx 20,0,%[SRC1]\n" \
|
"lvx 20,0,%[SRC1]\n" \
|
||||||
"lvx 19,0,%[SRC2]\n" \
|
"lvx 19,0,%[SRC2]\n" \
|
||||||
@@ -189,7 +185,7 @@ typedef struct v {
|
|||||||
: "v18", "v19", "v20", "v21"); \
|
: "v18", "v19", "v20", "v21"); \
|
||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx 21,0,%[SRC0]\n" \
|
"lvx 21,0,%[SRC0]\n" \
|
||||||
"lvx 20,0,%[SRC1]\n" \
|
"lvx 20,0,%[SRC1]\n" \
|
||||||
"vxor " VR0(r) "," VR0(r) ",21\n" \
|
"vxor " VR0(r) "," VR0(r) ",21\n" \
|
||||||
@@ -208,7 +204,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vxor " VR4(r) "," VR4(r) "," VR0(r) "\n" \
|
"vxor " VR4(r) "," VR4(r) "," VR0(r) "\n" \
|
||||||
"vxor " VR5(r) "," VR5(r) "," VR1(r) "\n" \
|
"vxor " VR5(r) "," VR5(r) "," VR1(r) "\n" \
|
||||||
"vxor " VR6(r) "," VR6(r) "," VR2(r) "\n" \
|
"vxor " VR6(r) "," VR6(r) "," VR2(r) "\n" \
|
||||||
@@ -217,7 +213,7 @@ typedef struct v {
|
|||||||
: RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
|
: RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vxor " VR2(r) "," VR2(r) "," VR0(r) "\n" \
|
"vxor " VR2(r) "," VR2(r) "," VR0(r) "\n" \
|
||||||
"vxor " VR3(r) "," VR3(r) "," VR1(r) "\n" \
|
"vxor " VR3(r) "," VR3(r) "," VR1(r) "\n" \
|
||||||
: UVR2(r), UVR3(r) \
|
: UVR2(r), UVR3(r) \
|
||||||
@@ -232,7 +228,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
||||||
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
||||||
"vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
|
"vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
|
||||||
@@ -245,7 +241,7 @@ typedef struct v {
|
|||||||
WVR4(r), WVR5(r), WVR6(r), WVR7(r)); \
|
WVR4(r), WVR5(r), WVR6(r), WVR7(r)); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
||||||
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
||||||
"vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
|
"vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
|
||||||
@@ -253,7 +249,7 @@ typedef struct v {
|
|||||||
: WVR0(r), WVR1(r), WVR2(r), WVR3(r)); \
|
: WVR0(r), WVR1(r), WVR2(r), WVR3(r)); \
|
||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
"vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
|
||||||
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
"vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
|
||||||
: WVR0(r), WVR1(r)); \
|
: WVR0(r), WVR1(r)); \
|
||||||
@@ -267,7 +263,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vor " VR4(r) "," VR0(r) "," VR0(r) "\n" \
|
"vor " VR4(r) "," VR0(r) "," VR0(r) "\n" \
|
||||||
"vor " VR5(r) "," VR1(r) "," VR1(r) "\n" \
|
"vor " VR5(r) "," VR1(r) "," VR1(r) "\n" \
|
||||||
"vor " VR6(r) "," VR2(r) "," VR2(r) "\n" \
|
"vor " VR6(r) "," VR2(r) "," VR2(r) "\n" \
|
||||||
@@ -276,7 +272,7 @@ typedef struct v {
|
|||||||
: RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
|
: RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vor " VR2(r) "," VR0(r) "," VR0(r) "\n" \
|
"vor " VR2(r) "," VR0(r) "," VR0(r) "\n" \
|
||||||
"vor " VR3(r) "," VR1(r) "," VR1(r) "\n" \
|
"vor " VR3(r) "," VR1(r) "," VR1(r) "\n" \
|
||||||
: WVR2(r), WVR3(r) \
|
: WVR2(r), WVR3(r) \
|
||||||
@@ -291,7 +287,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
||||||
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
||||||
"lvx " VR2(r) " ,0,%[SRC2]\n" \
|
"lvx " VR2(r) " ,0,%[SRC2]\n" \
|
||||||
@@ -312,7 +308,7 @@ typedef struct v {
|
|||||||
[SRC7] "r" ((OFFSET(src, 112)))); \
|
[SRC7] "r" ((OFFSET(src, 112)))); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
||||||
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
||||||
"lvx " VR2(r) " ,0,%[SRC2]\n" \
|
"lvx " VR2(r) " ,0,%[SRC2]\n" \
|
||||||
@@ -324,7 +320,7 @@ typedef struct v {
|
|||||||
[SRC3] "r" ((OFFSET(src, 48)))); \
|
[SRC3] "r" ((OFFSET(src, 48)))); \
|
||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
"lvx " VR0(r) " ,0,%[SRC0]\n" \
|
||||||
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
"lvx " VR1(r) " ,0,%[SRC1]\n" \
|
||||||
: WVR0(r), WVR1(r) \
|
: WVR0(r), WVR1(r) \
|
||||||
@@ -340,7 +336,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 8: \
|
case 8: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
||||||
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
||||||
"stvx " VR2(r) " ,0,%[DST2]\n" \
|
"stvx " VR2(r) " ,0,%[DST2]\n" \
|
||||||
@@ -362,7 +358,7 @@ typedef struct v {
|
|||||||
: "memory"); \
|
: "memory"); \
|
||||||
break; \
|
break; \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
||||||
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
||||||
"stvx " VR2(r) " ,0,%[DST2]\n" \
|
"stvx " VR2(r) " ,0,%[DST2]\n" \
|
||||||
@@ -375,7 +371,7 @@ typedef struct v {
|
|||||||
: "memory"); \
|
: "memory"); \
|
||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
"stvx " VR0(r) " ,0,%[DST0]\n" \
|
||||||
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
"stvx " VR1(r) " ,0,%[DST1]\n" \
|
||||||
: : [DST0] "r" ((OFFSET(dst, 0))), \
|
: : [DST0] "r" ((OFFSET(dst, 0))), \
|
||||||
@@ -400,7 +396,7 @@ typedef struct v {
|
|||||||
|
|
||||||
#define MUL2_SETUP() \
|
#define MUL2_SETUP() \
|
||||||
{ \
|
{ \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vspltisb " VR(16) ",14\n" \
|
"vspltisb " VR(16) ",14\n" \
|
||||||
"vspltisb " VR(17) ",15\n" \
|
"vspltisb " VR(17) ",15\n" \
|
||||||
"vaddubm " VR(16) "," VR(17) "," VR(16) "\n" \
|
"vaddubm " VR(16) "," VR(17) "," VR(16) "\n" \
|
||||||
@@ -412,7 +408,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 4: \
|
case 4: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
|
"vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
|
||||||
"vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
|
"vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
|
||||||
"vcmpgtsb 21," VR(17) "," VR2(r) "\n" \
|
"vcmpgtsb 21," VR(17) "," VR2(r) "\n" \
|
||||||
@@ -434,7 +430,7 @@ typedef struct v {
|
|||||||
: "v18", "v19", "v20", "v21"); \
|
: "v18", "v19", "v20", "v21"); \
|
||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
"vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
|
"vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
|
||||||
"vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
|
"vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
|
||||||
"vand 19,19," VR(16) "\n" \
|
"vand 19,19," VR(16) "\n" \
|
||||||
@@ -478,7 +474,7 @@ typedef struct v {
|
|||||||
{ \
|
{ \
|
||||||
switch (REG_CNT(r)) { \
|
switch (REG_CNT(r)) { \
|
||||||
case 2: \
|
case 2: \
|
||||||
__asm( \
|
__asm__ __volatile__( \
|
||||||
/* lts for upper part */ \
|
/* lts for upper part */ \
|
||||||
"vspltisb 15,15\n" \
|
"vspltisb 15,15\n" \
|
||||||
"lvx 10,0,%[lt0]\n" \
|
"lvx 10,0,%[lt0]\n" \
|
||||||
|
|||||||
@@ -822,7 +822,8 @@ tests = ['recv_dedup', 'recv_dedup_encrypted_zvol', 'rsend_001_pos',
|
|||||||
'send-c_lz4_disabled', 'send-c_recv_lz4_disabled',
|
'send-c_lz4_disabled', 'send-c_recv_lz4_disabled',
|
||||||
'send-c_mixed_compression', 'send-c_stream_size_estimate',
|
'send-c_mixed_compression', 'send-c_stream_size_estimate',
|
||||||
'send-c_embedded_blocks', 'send-c_resume', 'send-cpL_varied_recsize',
|
'send-c_embedded_blocks', 'send-c_resume', 'send-cpL_varied_recsize',
|
||||||
'send-c_recv_dedup', 'send-L_toggle', 'send_encrypted_hierarchy',
|
'send-c_recv_dedup', 'send-L_toggle',
|
||||||
|
'send_encrypted_incremental.ksh', 'send_encrypted_hierarchy',
|
||||||
'send_encrypted_props', 'send_encrypted_truncated_files',
|
'send_encrypted_props', 'send_encrypted_truncated_files',
|
||||||
'send_freeobjects', 'send_realloc_files',
|
'send_freeobjects', 'send_realloc_files',
|
||||||
'send_realloc_encrypted_files', 'send_spill_block', 'send_holds',
|
'send_realloc_encrypted_files', 'send_spill_block', 'send_holds',
|
||||||
|
|||||||
@@ -96,10 +96,7 @@ function log_must_retry
|
|||||||
out="cat $logfile"
|
out="cat $logfile"
|
||||||
|
|
||||||
if (( $status == 0 )); then
|
if (( $status == 0 )); then
|
||||||
$out | egrep -i "internal error|assertion failed" \
|
if $out | grep -qEi "internal error|assertion failed"; then
|
||||||
> /dev/null 2>&1
|
|
||||||
# internal error or assertion failed
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
print -u2 $($out)
|
print -u2 $($out)
|
||||||
_printerror "$@" "internal error or" \
|
_printerror "$@" "internal error or" \
|
||||||
" assertion failure exited $status"
|
" assertion failure exited $status"
|
||||||
@@ -224,10 +221,7 @@ function log_neg_expect
|
|||||||
print -u2 $($out)
|
print -u2 $($out)
|
||||||
_printerror "$@" "unexpectedly exited $status (SEGV)"
|
_printerror "$@" "unexpectedly exited $status (SEGV)"
|
||||||
else
|
else
|
||||||
$out | egrep -i "internal error|assertion failed" \
|
if $out | grep -qEi "internal error|assertion failed"; then
|
||||||
> /dev/null 2>&1
|
|
||||||
# internal error or assertion failed
|
|
||||||
if (( $? == 0 )); then
|
|
||||||
print -u2 $($out)
|
print -u2 $($out)
|
||||||
_printerror "$@" "internal error or assertion failure" \
|
_printerror "$@" "internal error or assertion failure" \
|
||||||
" exited $status"
|
" exited $status"
|
||||||
@@ -275,10 +269,7 @@ function log_pos
|
|||||||
print -u2 $($out)
|
print -u2 $($out)
|
||||||
_printerror "$@" "exited $status"
|
_printerror "$@" "exited $status"
|
||||||
else
|
else
|
||||||
$out | egrep -i "internal error|assertion failed" \
|
if $out | grep -qEi "internal error|assertion failed"; then
|
||||||
> /dev/null 2>&1
|
|
||||||
# internal error or assertion failed
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
print -u2 $($out)
|
print -u2 $($out)
|
||||||
_printerror "$@" "internal error or assertion failure" \
|
_printerror "$@" "internal error or assertion failure" \
|
||||||
" exited $status"
|
" exited $status"
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ main(int argc, char **argv)
|
|||||||
return (errors);
|
return (errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage()
|
static void usage(void)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr, gettext(
|
(void) fprintf(stderr, gettext(
|
||||||
"Usage: mkfile [-nv] <size>[g|k|b|m] <name1> [<name2>] ...\n"));
|
"Usage: mkfile [-nv] <size>[g|k|b|m] <name1> [<name2>] ...\n"));
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define NORMAL_WRITE_TH_NUM 2
|
#define NORMAL_WRITE_TH_NUM 2
|
||||||
|
#define MAX_WRITE_BYTES 262144000
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
normal_writer(void *filename)
|
normal_writer(void *filename)
|
||||||
@@ -67,18 +68,29 @@ normal_writer(void *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *buf = malloc(1);
|
char *buf = malloc(1);
|
||||||
while (1) {
|
off_t bytes_written = 0;
|
||||||
|
|
||||||
|
while (bytes_written < MAX_WRITE_BYTES) {
|
||||||
write_num = write(fd, buf, 1);
|
write_num = write(fd, buf, 1);
|
||||||
if (write_num == 0) {
|
if (write_num == 0) {
|
||||||
err(1, "write failed!");
|
err(1, "write failed!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lseek(fd, page_size, SEEK_CUR);
|
if ((bytes_written = lseek(fd, page_size, SEEK_CUR)) == -1) {
|
||||||
|
err(1, "lseek failed on %s: %s", file_path,
|
||||||
|
strerror(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (close(fd) != 0)
|
||||||
|
err(1, "failed to close file");
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|||||||
@@ -115,21 +115,18 @@ function is_physical_device #device
|
|||||||
|
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
is_disk_device "$DEV_DSKDIR/$device" && \
|
is_disk_device "$DEV_DSKDIR/$device" && \
|
||||||
[[ -f /sys/module/loop/parameters/max_part ]]
|
[ -f /sys/module/loop/parameters/max_part ]
|
||||||
return $?
|
|
||||||
elif is_freebsd; then
|
elif is_freebsd; then
|
||||||
is_disk_device "$DEV_DSKDIR/$device" && \
|
is_disk_device "$DEV_DSKDIR/$device" && \
|
||||||
echo $device | egrep -q \
|
echo $device | grep -qE \
|
||||||
-e '^a?da[0-9]+$' \
|
-e '^a?da[0-9]+$' \
|
||||||
-e '^md[0-9]+$' \
|
-e '^md[0-9]+$' \
|
||||||
-e '^mfid[0-9]+$' \
|
-e '^mfid[0-9]+$' \
|
||||||
-e '^nda[0-9]+$' \
|
-e '^nda[0-9]+$' \
|
||||||
-e '^nvd[0-9]+$' \
|
-e '^nvd[0-9]+$' \
|
||||||
-e '^vtbd[0-9]+$'
|
-e '^vtbd[0-9]+$'
|
||||||
return $?
|
|
||||||
else
|
else
|
||||||
echo $device | egrep "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
|
echo $device | grep -qE "^c[0-F]+([td][0-F]+)+$"
|
||||||
return $?
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,8 +140,7 @@ function is_real_device #disk
|
|||||||
|
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
|
lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
|
||||||
egrep disk >/dev/null
|
grep -q disk
|
||||||
return $?
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +154,7 @@ function is_loop_device #disk
|
|||||||
|
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
|
lsblk $DEV_RDSKDIR/$disk -o TYPE 2>/dev/null | \
|
||||||
egrep loop >/dev/null
|
grep -q loop
|
||||||
return $?
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +177,7 @@ function is_mpath_device #disk
|
|||||||
|
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
lsblk $DEV_MPATHDIR/$disk -o TYPE 2>/dev/null | \
|
lsblk $DEV_MPATHDIR/$disk -o TYPE 2>/dev/null | \
|
||||||
egrep mpath >/dev/null
|
grep -q mpath
|
||||||
if (($? == 0)); then
|
if (($? == 0)); then
|
||||||
readlink $DEV_MPATHDIR/$disk > /dev/null 2>&1
|
readlink $DEV_MPATHDIR/$disk > /dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
@@ -301,12 +296,12 @@ function get_persistent_disk_name #device
|
|||||||
if is_linux; then
|
if is_linux; then
|
||||||
if is_real_device $device; then
|
if is_real_device $device; then
|
||||||
dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
|
dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
|
||||||
| egrep disk/by-id | nawk '{print $2; exit}' \
|
| grep -E "disk/by-id" | nawk '{print $2; exit}' \
|
||||||
| nawk -F / '{print $3}')"
|
| nawk -F / '{print $3}')"
|
||||||
echo $dev_id
|
echo $dev_id
|
||||||
elif is_mpath_device $device; then
|
elif is_mpath_device $device; then
|
||||||
dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
|
dev_id="$(udevadm info -q all -n $DEV_DSKDIR/$device \
|
||||||
| egrep disk/by-id/dm-uuid \
|
| grep -E "disk/by-id/dm-uuid" \
|
||||||
| nawk '{print $2; exit}' \
|
| nawk '{print $2; exit}' \
|
||||||
| nawk -F / '{print $3}')"
|
| nawk -F / '{print $3}')"
|
||||||
echo $dev_id
|
echo $dev_id
|
||||||
@@ -342,7 +337,7 @@ function on_off_disk # disk state{online,offline} host
|
|||||||
| nawk '{print $1}')"
|
| nawk '{print $1}')"
|
||||||
while [[ -n $dep ]]; do
|
while [[ -n $dep ]]; do
|
||||||
#check if disk is online
|
#check if disk is online
|
||||||
lsscsi | egrep $dep > /dev/null
|
lsscsi | grep -qF $dep
|
||||||
if (($? == 0)); then
|
if (($? == 0)); then
|
||||||
dep_dir="/sys/block/${dm_name}"
|
dep_dir="/sys/block/${dm_name}"
|
||||||
dep_dir+="/slaves/${dep}/device"
|
dep_dir+="/slaves/${dep}/device"
|
||||||
@@ -350,7 +345,7 @@ function on_off_disk # disk state{online,offline} host
|
|||||||
sd="${dep_dir}/delete"
|
sd="${dep_dir}/delete"
|
||||||
log_must eval "echo 'offline' > ${ss}"
|
log_must eval "echo 'offline' > ${ss}"
|
||||||
log_must eval "echo '1' > ${sd}"
|
log_must eval "echo '1' > ${sd}"
|
||||||
lsscsi | egrep $dep > /dev/null
|
lsscsi | grep -qF $dep
|
||||||
if (($? == 0)); then
|
if (($? == 0)); then
|
||||||
log_fail "Offlining" \
|
log_fail "Offlining" \
|
||||||
"$disk failed"
|
"$disk failed"
|
||||||
@@ -361,17 +356,14 @@ function on_off_disk # disk state{online,offline} host
|
|||||||
done
|
done
|
||||||
elif [[ $state == "offline" ]] && ( is_real_device $disk ); then
|
elif [[ $state == "offline" ]] && ( is_real_device $disk ); then
|
||||||
#check if disk is online
|
#check if disk is online
|
||||||
lsscsi | egrep $disk > /dev/null
|
if lsscsi | grep -qF $disk; then
|
||||||
if (($? == 0)); then
|
|
||||||
dev_state="/sys/block/$disk/device/state"
|
dev_state="/sys/block/$disk/device/state"
|
||||||
dev_delete="/sys/block/$disk/device/delete"
|
dev_delete="/sys/block/$disk/device/delete"
|
||||||
log_must eval "echo 'offline' > ${dev_state}"
|
log_must eval "echo 'offline' > ${dev_state}"
|
||||||
log_must eval "echo '1' > ${dev_delete}"
|
log_must eval "echo '1' > ${dev_delete}"
|
||||||
lsscsi | egrep $disk > /dev/null
|
if lsscsi | grep -qF $disk; then
|
||||||
if (($? == 0)); then
|
log_fail "Offlining $disk failed"
|
||||||
log_fail "Offlining $disk" \
|
fi
|
||||||
"failed"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
log_note "$disk is already offline"
|
log_note "$disk is already offline"
|
||||||
fi
|
fi
|
||||||
@@ -384,14 +376,14 @@ function on_off_disk # disk state{online,offline} host
|
|||||||
| nawk -F / '{print $2}')"
|
| nawk -F / '{print $2}')"
|
||||||
dep="$(ls /sys/block/$dm_name/slaves \
|
dep="$(ls /sys/block/$dm_name/slaves \
|
||||||
| nawk '{print $1}')"
|
| nawk '{print $1}')"
|
||||||
lsscsi | egrep $dep > /dev/null
|
lsscsi | grep -qF $dep
|
||||||
if (($? != 0)); then
|
if (($? != 0)); then
|
||||||
log_fail "Onlining $disk failed"
|
log_fail "Onlining $disk failed"
|
||||||
fi
|
fi
|
||||||
elif is_real_device $disk; then
|
elif is_real_device $disk; then
|
||||||
block_device_wait
|
block_device_wait
|
||||||
typeset -i retries=0
|
typeset -i retries=0
|
||||||
while ! lsscsi | egrep -q $disk; do
|
while ! lsscsi | grep -qF $disk; do
|
||||||
if (( $retries > 2 )); then
|
if (( $retries > 2 )); then
|
||||||
log_fail "Onlining $disk failed"
|
log_fail "Onlining $disk failed"
|
||||||
break
|
break
|
||||||
@@ -467,16 +459,14 @@ function load_scsi_debug # dev_size_mb add_host num_tgts max_luns blksz
|
|||||||
log_unsupported "Platform does not have scsi_debug"
|
log_unsupported "Platform does not have scsi_debug"
|
||||||
"module"
|
"module"
|
||||||
fi
|
fi
|
||||||
lsmod | egrep scsi_debug > /dev/null
|
if lsmod | grep -q scsi_debug; then
|
||||||
if (($? == 0)); then
|
|
||||||
log_fail "scsi_debug module already installed"
|
log_fail "scsi_debug module already installed"
|
||||||
else
|
else
|
||||||
log_must modprobe scsi_debug dev_size_mb=$devsize \
|
log_must modprobe scsi_debug dev_size_mb=$devsize \
|
||||||
add_host=$hosts num_tgts=$tgts max_luns=$luns \
|
add_host=$hosts num_tgts=$tgts max_luns=$luns \
|
||||||
sector_size=$sector physblk_exp=$blkexp
|
sector_size=$sector physblk_exp=$blkexp
|
||||||
block_device_wait
|
block_device_wait
|
||||||
lsscsi | egrep scsi_debug > /dev/null
|
if ! lsscsi | grep -q scsi_debug; then
|
||||||
if (($? == 1)); then
|
|
||||||
log_fail "scsi_debug module install failed"
|
log_fail "scsi_debug module install failed"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export SYSTEM_FILES_COMMON='arp
|
|||||||
dmesg
|
dmesg
|
||||||
du
|
du
|
||||||
echo
|
echo
|
||||||
egrep
|
|
||||||
env
|
env
|
||||||
expr
|
expr
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -2143,7 +2143,7 @@ function get_disklist # pool
|
|||||||
|
|
||||||
disklist=$(zpool iostat -v $1 | nawk '(NR >4) {print $1}' | \
|
disklist=$(zpool iostat -v $1 | nawk '(NR >4) {print $1}' | \
|
||||||
grep -v "\-\-\-\-\-" | \
|
grep -v "\-\-\-\-\-" | \
|
||||||
egrep -v -e "^(mirror|raidz[1-3]|draid[1-3]|spare|log|cache|special|dedup)|\-[0-9]$")
|
grep -vEe "^(mirror|raidz[1-3]|draid[1-3]|spare|log|cache|special|dedup)|\-[0-9]$")
|
||||||
|
|
||||||
echo $disklist
|
echo $disklist
|
||||||
}
|
}
|
||||||
@@ -2315,8 +2315,7 @@ function check_pool_status # pool token keyword <verbose>
|
|||||||
if [[ $verbose == true ]]; then
|
if [[ $verbose == true ]]; then
|
||||||
log_note $scan
|
log_note $scan
|
||||||
fi
|
fi
|
||||||
echo $scan | egrep -i "$keyword" > /dev/null 2>&1
|
echo $scan | grep -qi "$keyword"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ log_onexit cleanup
|
|||||||
log_note "Testing access to FILE"
|
log_note "Testing access to FILE"
|
||||||
log_must touch $TESTDIR/file.0
|
log_must touch $TESTDIR/file.0
|
||||||
log_must setfacl -m g:$ZFS_ACL_STAFF_GROUP:rw $TESTDIR/file.0
|
log_must setfacl -m g:$ZFS_ACL_STAFF_GROUP:rw $TESTDIR/file.0
|
||||||
getfacl $TESTDIR/file.0 2> /dev/null | egrep -q \
|
getfacl $TESTDIR/file.0 2> /dev/null | grep -q \
|
||||||
"^group:$ZFS_ACL_STAFF_GROUP:rw-$"
|
"^group:$ZFS_ACL_STAFF_GROUP:rw-$"
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
# Should be able to write to file
|
# Should be able to write to file
|
||||||
@@ -76,7 +76,7 @@ if [ "$?" -eq "0" ]; then
|
|||||||
log_note "expected mask drwxrw----+ but found $msk"
|
log_note "expected mask drwxrw----+ but found $msk"
|
||||||
log_fail "Expected permissions were not set."
|
log_fail "Expected permissions were not set."
|
||||||
fi
|
fi
|
||||||
getfacl $TESTDIR/dir.0 2> /dev/null | egrep -q \
|
getfacl $TESTDIR/dir.0 2> /dev/null | grep -q \
|
||||||
"^group:$ZFS_ACL_STAFF_GROUP:rw-$"
|
"^group:$ZFS_ACL_STAFF_GROUP:rw-$"
|
||||||
if [ "$?" -ne "0" ]; then
|
if [ "$?" -ne "0" ]; then
|
||||||
acl=$(getfacl $TESTDIR/dir.0 2> /dev/null)
|
acl=$(getfacl $TESTDIR/dir.0 2> /dev/null)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ if [ "$?" -ne "0" ]; then
|
|||||||
log_note "expected mask drwx-wx---+ but found $msk"
|
log_note "expected mask drwx-wx---+ but found $msk"
|
||||||
log_fail "Expected permissions were not set."
|
log_fail "Expected permissions were not set."
|
||||||
fi
|
fi
|
||||||
getfacl $TESTDIR/dir.0 2> /dev/null | egrep -q \
|
getfacl $TESTDIR/dir.0 2> /dev/null | grep -q \
|
||||||
"^group:$ZFS_ACL_STAFF_GROUP:-wx$"
|
"^group:$ZFS_ACL_STAFF_GROUP:-wx$"
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
# Should be able to create file in directory
|
# Should be able to create file in directory
|
||||||
|
|||||||
@@ -43,16 +43,14 @@ log_note "Testing access to DIRECTORY"
|
|||||||
log_must mkdir $ACLDIR
|
log_must mkdir $ACLDIR
|
||||||
log_must setfacl -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
|
log_must setfacl -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
|
||||||
log_must setfacl -d -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
|
log_must setfacl -d -m g:$ZFS_ACL_STAFF_GROUP:wx $ACLDIR
|
||||||
getfacl $ACLDIR 2> /dev/null | egrep -q "$acl_str1"
|
|
||||||
if [ "$?" -eq "0" ]; then
|
|
||||||
getfacl $ACLDIR 2> /dev/null | egrep -q "$acl_str2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$?" -eq "0" ]; then
|
if getfacl $ACLDIR 2> /dev/null | grep -q "$acl_str1" &&
|
||||||
|
getfacl $ACLDIR 2> /dev/null | grep -q "$acl_str2"
|
||||||
|
then
|
||||||
log_must zfs unmount $TESTPOOL/$TESTFS
|
log_must zfs unmount $TESTPOOL/$TESTFS
|
||||||
log_must zfs mount $TESTPOOL/$TESTFS
|
log_must zfs mount $TESTPOOL/$TESTFS
|
||||||
log_must eval "getfacl $ACLDIR 2> /dev/null | egrep -q \"$acl_str1\""
|
log_must eval "getfacl $ACLDIR 2> /dev/null | grep -q \"$acl_str1\""
|
||||||
log_must eval "getfacl $ACLDIR 2> /dev/null | egrep -q \"$acl_str2\""
|
log_must eval "getfacl $ACLDIR 2> /dev/null | grep -q \"$acl_str2\""
|
||||||
log_pass "POSIX ACLs survive remount"
|
log_pass "POSIX ACLs survive remount"
|
||||||
else
|
else
|
||||||
log_fail "Group '$ZFS_ACL_STAFF_GROUP' does not have 'rwx'"
|
log_fail "Group '$ZFS_ACL_STAFF_GROUP' does not have 'rwx'"
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
# STRATEGY:
|
# STRATEGY:
|
||||||
# 1. Prepare an appropriate ACL on the test directory
|
# 1. Prepare an appropriate ACL on the test directory
|
||||||
# 2. Change the owner of the directory
|
# 2. Change the owner of the directory
|
||||||
|
# 3. Reset and set the ACLs for test directory owned by the user
|
||||||
#
|
#
|
||||||
|
|
||||||
verify_runnable "both"
|
verify_runnable "both"
|
||||||
@@ -44,6 +45,8 @@ log_must setfacl -d -m u:$ZFS_ACL_STAFF1:rwx $TESTDIR
|
|||||||
log_must setfacl -b $TESTDIR
|
log_must setfacl -b $TESTDIR
|
||||||
|
|
||||||
log_must chown $ZFS_ACL_STAFF1 $TESTDIR
|
log_must chown $ZFS_ACL_STAFF1 $TESTDIR
|
||||||
|
log_must setfacl -b $TESTDIR
|
||||||
|
log_must setfacl -d -m u:$ZFS_ACL_STAFF1:rwx $TESTDIR
|
||||||
log_must chown 0 $TESTDIR
|
log_must chown 0 $TESTDIR
|
||||||
|
|
||||||
log_pass "chown works with POSIX ACLs"
|
log_pass "chown works with POSIX ACLs"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ do
|
|||||||
special $stype $sdisks
|
special $stype $sdisks
|
||||||
|
|
||||||
ac_value="$(zpool get -H -o property,value all | \
|
ac_value="$(zpool get -H -o property,value all | \
|
||||||
egrep allocation_classes | nawk '{print $2}')"
|
grep allocation_classes | nawk '{print $2}')"
|
||||||
if [ "$ac_value" = "active" ]; then
|
if [ "$ac_value" = "active" ]; then
|
||||||
log_note "feature@allocation_classes is active"
|
log_note "feature@allocation_classes is active"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ do
|
|||||||
log_must zpool create $TESTPOOL $type $ZPOOL_DISKS
|
log_must zpool create $TESTPOOL $type $ZPOOL_DISKS
|
||||||
fi
|
fi
|
||||||
ac_value="$(zpool get -H -o property,value all | \
|
ac_value="$(zpool get -H -o property,value all | \
|
||||||
egrep allocation_classes | awk '{print $2}')"
|
grep allocation_classes | awk '{print $2}')"
|
||||||
if [ "$ac_value" = "enabled" ]; then
|
if [ "$ac_value" = "enabled" ]; then
|
||||||
log_note "feature@allocation_classes is enabled"
|
log_note "feature@allocation_classes is enabled"
|
||||||
else
|
else
|
||||||
@@ -57,7 +57,7 @@ do
|
|||||||
$CLASS_DISK0 $CLASS_DISK1
|
$CLASS_DISK0 $CLASS_DISK1
|
||||||
fi
|
fi
|
||||||
ac_value="$(zpool get -H -o property,value all | \
|
ac_value="$(zpool get -H -o property,value all | \
|
||||||
egrep allocation_classes | awk '{print $2}')"
|
grep allocation_classes | awk '{print $2}')"
|
||||||
if [ "$ac_value" = "active" ]; then
|
if [ "$ac_value" = "active" ]; then
|
||||||
log_note "feature@allocation_classes is active"
|
log_note "feature@allocation_classes is active"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ function histo_populate_test_pool
|
|||||||
of=/${pool}/B_${this_rs}/file_${filenum} \
|
of=/${pool}/B_${this_rs}/file_${filenum} \
|
||||||
bs=${this_rs} count=${thiscount} \
|
bs=${this_rs} count=${thiscount} \
|
||||||
iflag=fullblock 2>&1 | \
|
iflag=fullblock 2>&1 | \
|
||||||
egrep -v -e "records in" -e "records out" \
|
grep -ve "records in" -e "records out" -e "bytes.*copied"
|
||||||
-e "bytes.*copied"
|
|
||||||
((filenum+=1))
|
((filenum+=1))
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ done
|
|||||||
|
|
||||||
# Specifying a non-existent object identifier returns an error
|
# Specifying a non-existent object identifier returns an error
|
||||||
obj_id_highest=$(zdb -P -dd $TESTPOOL/$TESTFS 2>/dev/null |
|
obj_id_highest=$(zdb -P -dd $TESTPOOL/$TESTFS 2>/dev/null |
|
||||||
egrep "^ +-?([0-9]+ +){7}" | sort -n | tail -n 1 | awk '{print $1}')
|
grep -E "^ +-?([0-9]+ +){7}" | sort -n | tail -n 1 | awk '{print $1}')
|
||||||
obj_id_invalid=$(( $obj_id_highest + 1 ))
|
obj_id_invalid=$(( $obj_id_highest + 1 ))
|
||||||
log_mustnot zdb -dd $TESTPOOL/$TESTFS $obj_id_invalid
|
log_mustnot zdb -dd $TESTPOOL/$TESTFS $obj_id_invalid
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,7 @@ function get_object_list_range
|
|||||||
function get_object_list
|
function get_object_list
|
||||||
{
|
{
|
||||||
zdb -P -dd $@ 2>/dev/null |
|
zdb -P -dd $@ 2>/dev/null |
|
||||||
egrep "^ +-?([0-9]+ +){7}" |
|
sed -E '/^ +-?([0-9]+ +){7}/!d;s/^[[:space:]]*//' |
|
||||||
sed 's/^[[:space:]]*//' |
|
|
||||||
sort -n
|
sort -n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
# STRATEGY:
|
# STRATEGY:
|
||||||
# 1. Create a multiple depth filesystem.
|
# 1. Create a multiple depth filesystem.
|
||||||
# 2. 'zfs get -d <n>' to get the output.
|
# 2. 'zfs get -d <n>' to get the output.
|
||||||
# 3. 'zfs get -r|egrep' to get the expected output.
|
# 3. 'zfs get -r|grep' to get the expected output.
|
||||||
# 4. Compare the two outputs, they should be same.
|
# 4. Compare the two outputs, they should be same.
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ for dp in ${depth_array[@]}; do
|
|||||||
done
|
done
|
||||||
for prop in $(gen_option_str "${all_props[*]}" "" "," $prop_numb); do
|
for prop in $(gen_option_str "${all_props[*]}" "" "," $prop_numb); do
|
||||||
log_must eval "zfs get -H -d $dp -o name $prop $DEPTH_FS > $DEPTH_OUTPUT"
|
log_must eval "zfs get -H -d $dp -o name $prop $DEPTH_FS > $DEPTH_OUTPUT"
|
||||||
log_must eval "zfs get -rH -o name $prop $DEPTH_FS | egrep -e '$eg_opt' > $EXPECT_OUTPUT"
|
log_must eval "zfs get -rH -o name $prop $DEPTH_FS | grep -E '$eg_opt' > $EXPECT_OUTPUT"
|
||||||
log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
|
log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
|
||||||
done
|
done
|
||||||
(( old_val=dp ))
|
(( old_val=dp ))
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ verify_runnable "both"
|
|||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
|
datasetexists $TESTPOOL/encrypted && \
|
||||||
|
destroy_dataset $TESTPOOL/encrypted -r
|
||||||
|
|
||||||
snapexists $snap && destroy_dataset $snap -f
|
snapexists $snap && destroy_dataset $snap -f
|
||||||
snapexists $snap2 && destroy_dataset $snap2 -f
|
snapexists $snap2 && destroy_dataset $snap2 -f
|
||||||
|
|
||||||
@@ -97,4 +100,15 @@ log_note "Verifying ZFS will not receive to an encrypted child when the" \
|
|||||||
"parent key is unloaded"
|
"parent key is unloaded"
|
||||||
log_mustnot eval "zfs send $snap | zfs receive $TESTPOOL/$TESTFS1/c4"
|
log_mustnot eval "zfs send $snap | zfs receive $TESTPOOL/$TESTFS1/c4"
|
||||||
|
|
||||||
|
# Verify that replication can override encryption properties
|
||||||
|
log_note "Verifying replication can override encryption properties for plain dataset"
|
||||||
|
typeset key_location="/$TESTPOOL/pkey1"
|
||||||
|
log_must eval "echo $passphrase > $key_location"
|
||||||
|
log_must eval "zfs send -R $snap2 | zfs recv -s -F -o encryption=on" \
|
||||||
|
"-o keyformat=passphrase -o keylocation=file://$key_location" \
|
||||||
|
"-o mountpoint=none $TESTPOOL/encrypted"
|
||||||
|
log_must test "$(get_prop 'encryption' $TESTPOOL/encrypted)" != "off"
|
||||||
|
log_must test "$(get_prop 'keyformat' $TESTPOOL/encrypted)" == "passphrase"
|
||||||
|
log_must test "$(get_prop 'keylocation' $TESTPOOL/encrypted)" == "file://$key_location"
|
||||||
|
|
||||||
log_pass "ZFS can receive encrypted filesystems into child dataset"
|
log_pass "ZFS can receive encrypted filesystems into child dataset"
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ do
|
|||||||
$file.1 $file.2 $file.3 $file.4
|
$file.1 $file.2 $file.3 $file.4
|
||||||
! poolexists $TESTPOOL && \
|
! poolexists $TESTPOOL && \
|
||||||
log_fail "Creating pool with $opt fails."
|
log_fail "Creating pool with $opt fails."
|
||||||
mpt=`zfs mount | egrep "^$TESTPOOL[^/]" | awk '{print $2}'`
|
mpt=`zfs mount | grep -E "^$TESTPOOL[^/]" | awk '{print $2}'`
|
||||||
(( ${#mpt} == 0 )) && \
|
(( ${#mpt} == 0 )) && \
|
||||||
log_fail "$TESTPOOL created with $opt is not mounted."
|
log_fail "$TESTPOOL created with $opt is not mounted."
|
||||||
mpt_val=$(get_prop "mountpoint" $TESTPOOL)
|
mpt_val=$(get_prop "mountpoint" $TESTPOOL)
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ function _translate_vdev
|
|||||||
#
|
#
|
||||||
typeset keywords="mirror replacing raidz1 raidz2 raidz3 indirect draid1 draid2 draid3"
|
typeset keywords="mirror replacing raidz1 raidz2 raidz3 indirect draid1 draid2 draid3"
|
||||||
for word in $keywords; do
|
for word in $keywords; do
|
||||||
echo $vdev | egrep -qE \
|
echo $vdev | grep -qE \
|
||||||
"^${word}-[0-9]+\$|^${word}:[0-9]+d:[0-9]c:[0-9]+s-[0-9]+\$"
|
"^${word}-[0-9]+\$|^${word}:[0-9]+d:[0-9]c:[0-9]+s-[0-9]+\$"
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
vdev=$word
|
vdev=$word
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ while read -r offset_size; do
|
|||||||
# Note we use '-t x4' instead of '-t x8' here because x8 is not
|
# Note we use '-t x4' instead of '-t x8' here because x8 is not
|
||||||
# a supported format on FreeBSD.
|
# a supported format on FreeBSD.
|
||||||
dd if=$SMALLFILE skip=$((offset / bs)) count=$((size / bs)) bs=$bs |
|
dd if=$SMALLFILE skip=$((offset / bs)) count=$((size / bs)) bs=$bs |
|
||||||
od -t x4 -Ad | egrep -q "deadbeef +deadbeef +deadbeef +deadbeef" ||
|
od -t x4 -Ad | grep -qE "deadbeef +deadbeef +deadbeef +deadbeef" ||
|
||||||
log_fail "Pattern not found in metaslab free space"
|
log_fail "Pattern not found in metaslab free space"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -120,5 +120,5 @@ function check_while_waiting
|
|||||||
# Whether any vdev in the given pool is initializing
|
# Whether any vdev in the given pool is initializing
|
||||||
function is_vdev_initializing # pool
|
function is_vdev_initializing # pool
|
||||||
{
|
{
|
||||||
zpool status -i "$1" | grep 'initialized, started' >/dev/null
|
zpool status -i "$1" | grep -q 'initialized, started'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#
|
#
|
||||||
# STRATEGY:
|
# STRATEGY:
|
||||||
# 1. 'zfs list -d <n>' to get the output.
|
# 1. 'zfs list -d <n>' to get the output.
|
||||||
# 2. 'zfs list -r|egrep' to get the expected output.
|
# 2. 'zfs list -r|grep' to get the expected output.
|
||||||
# 3. Compare the two outputs, they should be same.
|
# 3. Compare the two outputs, they should be same.
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -50,8 +50,7 @@ fi
|
|||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
log_must rm -f $DEPTH_OUTPUT
|
log_must rm -f $DEPTH_OUTPUT $EXPECT_OUTPUT
|
||||||
log_must rm -f $EXPECT_OUTPUT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log_onexit cleanup
|
log_onexit cleanup
|
||||||
@@ -76,10 +75,10 @@ for dp in ${depth_array[@]}; do
|
|||||||
log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
|
log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
|
||||||
[[ -s "$DEPTH_OUTPUT" ]] && \
|
[[ -s "$DEPTH_OUTPUT" ]] && \
|
||||||
log_fail "$DEPTH_OUTPUT should be null."
|
log_fail "$DEPTH_OUTPUT should be null."
|
||||||
log_mustnot zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | egrep -e '$eg_opt'
|
log_mustnot zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | grep -E "$eg_opt"
|
||||||
else
|
else
|
||||||
log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
|
log_must eval "zfs list -H -d $dp -o name -t ${fs_type[$fs]} $DEPTH_FS > $DEPTH_OUTPUT"
|
||||||
log_must eval "zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | egrep -e '$eg_opt' > $EXPECT_OUTPUT"
|
log_must eval "zfs list -rH -o name -t ${fs_type[$fs]} $DEPTH_FS | grep -E '$eg_opt' > $EXPECT_OUTPUT"
|
||||||
log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
|
log_must diff $DEPTH_OUTPUT $EXPECT_OUTPUT
|
||||||
fi
|
fi
|
||||||
(( fs+=1 ))
|
(( fs+=1 ))
|
||||||
|
|||||||
@@ -134,9 +134,8 @@ do
|
|||||||
((timeout++))
|
((timeout++))
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
zpool events $TESTPOOL \
|
if zpool events $TESTPOOL \
|
||||||
| egrep sysevent.fs.zfs.resilver_finish > /dev/null
|
| grep -qF sysevent.fs.zfs.resilver_finish; then
|
||||||
if (($? == 0)); then
|
|
||||||
log_note "Auto-online of $offline_disk is complete"
|
log_note "Auto-online of $offline_disk is complete"
|
||||||
sleep 1
|
sleep 1
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ function is_data_valid
|
|||||||
log_must zpool scrub -w $pool
|
log_must zpool scrub -w $pool
|
||||||
|
|
||||||
record_data $pool $PST_RECORD_FILE
|
record_data $pool $PST_RECORD_FILE
|
||||||
if ! diff $PRE_RECORD_FILE $PST_RECORD_FILE > /dev/null 2>&1; then
|
if ! cmp $PRE_RECORD_FILE $PST_RECORD_FILE > /dev/null; then
|
||||||
log_must cat $PRE_RECORD_FILE
|
log_must cat $PRE_RECORD_FILE
|
||||||
log_must cat $PST_RECORD_FILE
|
log_must cat $PST_RECORD_FILE
|
||||||
diff -u $PRE_RECORD_FILE $PST_RECORD_FILE
|
diff -u $PRE_RECORD_FILE $PST_RECORD_FILE
|
||||||
@@ -243,8 +243,8 @@ function get_vdevs #pool cnt
|
|||||||
typeset -i cnt=$2
|
typeset -i cnt=$2
|
||||||
|
|
||||||
typeset all_devs=$(zpool iostat -v $pool | awk '{print $1}'| \
|
typeset all_devs=$(zpool iostat -v $pool | awk '{print $1}'| \
|
||||||
egrep -v "^pool$|^capacity$|^mirror\-[0-9]$|^raidz[1-3]\-[0-9]$|^draid[1-3].*\-[0-9]$|---" | \
|
grep -vEe "^pool$|^capacity$|^mirror\-[0-9]$|^raidz[1-3]\-[0-9]$|^draid[1-3].*\-[0-9]$|---" | \
|
||||||
egrep -v "/old$|^$pool$")
|
grep -vEe "/old$|^$pool$")
|
||||||
typeset -i i=0
|
typeset -i i=0
|
||||||
typeset vdevs
|
typeset vdevs
|
||||||
while ((i < cnt)); do
|
while ((i < cnt)); do
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function check_feature_flag
|
|||||||
expected_value=$3
|
expected_value=$3
|
||||||
|
|
||||||
value="$(zpool get -H -o property,value all $pool | \
|
value="$(zpool get -H -o property,value all $pool | \
|
||||||
egrep "$feature" | awk '{print $2}')"
|
grep -E "$feature" | awk '{print $2}')"
|
||||||
if [ "$value" = "$expected_value" ]; then
|
if [ "$value" = "$expected_value" ]; then
|
||||||
log_note "$feature verified to be $value"
|
log_note "$feature verified to be $value"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ dist_pkgdata_SCRIPTS = \
|
|||||||
send_invalid.ksh \
|
send_invalid.ksh \
|
||||||
send_mixed_raw.ksh \
|
send_mixed_raw.ksh \
|
||||||
send-wR_encrypted_zvol.ksh \
|
send-wR_encrypted_zvol.ksh \
|
||||||
send_doall.ksh
|
send_doall.ksh \
|
||||||
|
send_encrypted_incremental.ksh
|
||||||
|
|
||||||
dist_pkgdata_DATA = \
|
dist_pkgdata_DATA = \
|
||||||
dedup.zsend.bz2 \
|
dedup.zsend.bz2 \
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ function fs_inherit_prop
|
|||||||
else
|
else
|
||||||
fs_prop=$(zfs inherit 2>&1 | \
|
fs_prop=$(zfs inherit 2>&1 | \
|
||||||
awk '$2=="YES" && $3=="YES" {print $1}'|
|
awk '$2=="YES" && $3=="YES" {print $1}'|
|
||||||
egrep -v "devices|mlslabel|sharenfs|sharesmb|zoned")
|
grep -E -v "devices|mlslabel|sharenfs|sharesmb|zoned")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $fs_prop
|
echo $fs_prop
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function edited_prop
|
|||||||
"get")
|
"get")
|
||||||
typeset props=$(zfs inherit 2>&1 | \
|
typeset props=$(zfs inherit 2>&1 | \
|
||||||
awk '$2=="YES" {print $1}' | \
|
awk '$2=="YES" {print $1}' | \
|
||||||
egrep -v "^vol|\.\.\.$")
|
grep -E -v "^vol|\.\.\.$")
|
||||||
for item in $props ; do
|
for item in $props ; do
|
||||||
if [[ $item == "mlslabel" ]] && \
|
if [[ $item == "mlslabel" ]] && \
|
||||||
! is_te_enabled ; then
|
! is_te_enabled ; then
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
#!/bin/ksh -p
|
||||||
|
#
|
||||||
|
# CDDL HEADER START
|
||||||
|
#
|
||||||
|
# The contents of this file are subject to the terms of the
|
||||||
|
# Common Development and Distribution License (the "License").
|
||||||
|
# You may not use this file except in compliance with the License.
|
||||||
|
#
|
||||||
|
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||||
|
# or https://opensource.org/licenses/CDDL-1.0.
|
||||||
|
# See the License for the specific language governing permissions
|
||||||
|
# and limitations under the License.
|
||||||
|
#
|
||||||
|
# When distributing Covered Code, include this CDDL HEADER in each
|
||||||
|
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||||
|
# If applicable, add the following below this CDDL HEADER, with the
|
||||||
|
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||||
|
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||||
|
#
|
||||||
|
# CDDL HEADER END
|
||||||
|
#
|
||||||
|
|
||||||
|
. $STF_SUITE/include/libtest.shlib
|
||||||
|
. $STF_SUITE/tests/functional/rsend/rsend.kshlib
|
||||||
|
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# Incrementally receiving a snapshot to an encrypted filesystem succeeds.
|
||||||
|
#
|
||||||
|
# Strategy:
|
||||||
|
# 1) Create a pool and an encrypted fs
|
||||||
|
# 2) Create some files and snapshots
|
||||||
|
# 3) Send the first snapshot to a second encrypted as well as an
|
||||||
|
# unencrypted fs.
|
||||||
|
# 4) Incrementally send the second snapshot to the unencrypted fs.
|
||||||
|
# 5) Rollback the second encrypted fs to the first snapshot.
|
||||||
|
# 6) Incrementally send the second snapshot from the unencrypted to the
|
||||||
|
# second encrypted fs.
|
||||||
|
# 7) Incrementally send the third snapshot from the first encrypted to the
|
||||||
|
# unencrypted fs.
|
||||||
|
# 8) Incrementally send the third snapshot from the unencrypted to the second
|
||||||
|
# encrypted fs.
|
||||||
|
#
|
||||||
|
|
||||||
|
verify_runnable "both"
|
||||||
|
|
||||||
|
log_assert "Incrementally receiving a snapshot to an encrypted filesystem succeeds"
|
||||||
|
|
||||||
|
function cleanup
|
||||||
|
{
|
||||||
|
destroy_pool pool_lb
|
||||||
|
log_must rm -f $TESTDIR/vdev_a
|
||||||
|
}
|
||||||
|
|
||||||
|
log_onexit cleanup
|
||||||
|
|
||||||
|
typeset passphrase="password"
|
||||||
|
typeset passphrase2="password2"
|
||||||
|
|
||||||
|
typeset file="/pool_lb/encryptme/$TESTFILE0"
|
||||||
|
typeset file1="/pool_lb/encryptme/$TESTFILE1"
|
||||||
|
typeset file2="/pool_lb/encryptme/$TESTFILE2"
|
||||||
|
|
||||||
|
# Create pool
|
||||||
|
truncate -s $MINVDEVSIZE $TESTDIR/vdev_a
|
||||||
|
log_must zpool create -f pool_lb $TESTDIR/vdev_a
|
||||||
|
log_must eval "echo $passphrase > /pool_lb/pwd"
|
||||||
|
log_must eval "echo $passphrase2 > /pool_lb/pwd2"
|
||||||
|
|
||||||
|
log_must zfs create -o encryption=on -o keyformat=passphrase \
|
||||||
|
-o keylocation=file:///pool_lb/pwd pool_lb/encryptme
|
||||||
|
log_must dd if=/dev/urandom of=$file bs=1024 count=1024
|
||||||
|
log_must zfs snapshot pool_lb/encryptme@snap1
|
||||||
|
log_must dd if=/dev/urandom of=$file1 bs=1024 count=1024
|
||||||
|
log_must zfs snapshot pool_lb/encryptme@snap2
|
||||||
|
log_must dd if=/dev/urandom of=$file2 bs=1024 count=1024
|
||||||
|
log_must zfs snapshot pool_lb/encryptme@snap3
|
||||||
|
log_must eval "zfs send -Lc pool_lb/encryptme@snap1 | zfs recv \
|
||||||
|
-o encryption=on -o keyformat=passphrase -o keylocation=file:///pool_lb/pwd2 \
|
||||||
|
pool_lb/encrypttwo"
|
||||||
|
log_must eval "zfs send -Lc pool_lb/encryptme@snap1 | zfs recv \
|
||||||
|
pool_lb/unencryptme"
|
||||||
|
log_must eval "zfs send -Lc -i pool_lb/encryptme@{snap1,snap2} | zfs recv \
|
||||||
|
pool_lb/unencryptme"
|
||||||
|
log_must zfs rollback pool_lb/encrypttwo@snap1
|
||||||
|
log_must eval "zfs send -Lc -i pool_lb/unencryptme@{snap1,snap2} | zfs recv \
|
||||||
|
pool_lb/encrypttwo"
|
||||||
|
log_must eval "zfs send -Lc -i pool_lb/encryptme@{snap2,snap3} | zfs recv \
|
||||||
|
pool_lb/unencryptme"
|
||||||
|
log_must eval "zfs send -Lc -i pool_lb/unencryptme@{snap2,snap3} | zfs recv \
|
||||||
|
-F pool_lb/encrypttwo"
|
||||||
|
|
||||||
|
log_pass "Incrementally receiving a snapshot to an encrypted filesystem succeeds"
|
||||||
@@ -49,7 +49,7 @@ raw_backup=$TEST_BASE_DIR/raw_backup
|
|||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
log_must rm -f $backup $raw_backup $ibackup $unc_backup
|
log_must rm -f $backup $raw_backup $ibackup $unc_backup
|
||||||
destroy_pool pool_lb/fs
|
destroy_pool pool_lb
|
||||||
log_must rm -f $TESTDIR/vdev_a
|
log_must rm -f $TESTDIR/vdev_a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ function get_conf_section # regex conf
|
|||||||
function get_leaf_vd_zap # dsk conf
|
function get_leaf_vd_zap # dsk conf
|
||||||
{
|
{
|
||||||
typeset section=$(get_conf_section "$1" "$2")
|
typeset section=$(get_conf_section "$1" "$2")
|
||||||
echo "$section" | egrep \
|
echo "$section" | grep -E \
|
||||||
"com.delphix:vdev_zap_leaf: [0-9]+" | awk '{print $2}'
|
"com.delphix:vdev_zap_leaf: [0-9]+" | awk '{print $2}'
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_top_vd_zap # dsk conf
|
function get_top_vd_zap # dsk conf
|
||||||
{
|
{
|
||||||
typeset section=$(get_conf_section "$1" "$2")
|
typeset section=$(get_conf_section "$1" "$2")
|
||||||
echo "$section" | egrep \
|
echo "$section" | grep -E \
|
||||||
"com.delphix:vdev_zap_top: [0-9]+" | awk '{print $2}'
|
"com.delphix:vdev_zap_top: [0-9]+" | awk '{print $2}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user