mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6150fbe67f | |||
| 458bb8c8a1 | |||
| cda6fdd500 | |||
| df8271301e | |||
| e219935f10 | |||
| bb9104f1e8 | |||
| 94b240bae0 | |||
| e93203e004 | |||
| ccb453acd0 | |||
| 6c1989923e | |||
| a0eb5a77a0 | |||
| fe77c48320 | |||
| db9b29895e | |||
| 4d4dd76f0f | |||
| 286c7f75bb | |||
| 403703d57a | |||
| f17c843eff | |||
| f6440fa094 | |||
| 62f9691e10 | |||
| 73e26fdc09 | |||
| 65a89d9f49 | |||
| 8829ba19b7 | |||
| 642d86af0d | |||
| 07ca7592ad | |||
| fb0d807477 | |||
| 858ea8861c | |||
| 549841ef9a | |||
| 96f322e7e2 |
@@ -0,0 +1,64 @@
|
||||
name: zfs-tests-functional
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tests-functional-ubuntu:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [18.04, 20.04]
|
||||
runs-on: ubuntu-${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
|
||||
git alien fakeroot wget curl bc fio acl \
|
||||
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
|
||||
nfs-kernel-server samba rng-tools xz-utils \
|
||||
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||
libpam0g-dev pamtester python-dev python-setuptools python-cffi \
|
||||
python3 python3-dev python3-setuptools python3-cffi
|
||||
- name: Autogen.sh
|
||||
run: |
|
||||
sh autogen.sh
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --enable-debug --enable-debuginfo
|
||||
- name: Make
|
||||
run: |
|
||||
make --no-print-directory -s pkg-utils pkg-kmod
|
||||
- name: Install
|
||||
run: |
|
||||
sudo dpkg -i *.deb
|
||||
# Update order of directories to search for modules, otherwise
|
||||
# Ubuntu will load kernel-shipped ones.
|
||||
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||
sudo depmod
|
||||
sudo modprobe zfs
|
||||
- name: Tests
|
||||
run: |
|
||||
/usr/share/zfs/zfs-tests.sh -v -s 3G
|
||||
- name: Prepare artifacts
|
||||
if: failure()
|
||||
run: |
|
||||
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
||||
sudo dmesg > $RESULTS_PATH/dmesg
|
||||
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||
sudo chmod +r $RESULTS_PATH/*
|
||||
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: Test logs Ubuntu-${{ matrix.os }}
|
||||
path: /var/tmp/test_results/20*/
|
||||
if-no-files-found: ignore
|
||||
@@ -50,6 +50,8 @@ jobs:
|
||||
sudo dmesg > $RESULTS_PATH/dmesg
|
||||
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||
sudo chmod +r $RESULTS_PATH/*
|
||||
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
@@ -1,10 +1,10 @@
|
||||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 2.0.2
|
||||
Version: 2.0.4
|
||||
Release: 1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
Author: OpenZFS
|
||||
Linux-Maximum: 5.10
|
||||
Linux-Maximum: 5.11
|
||||
Linux-Minimum: 3.10
|
||||
|
||||
@@ -6790,9 +6790,6 @@ report_mount_progress(int current, int total)
|
||||
time_t now = time(NULL);
|
||||
char info[32];
|
||||
|
||||
/* report 1..n instead of 0..n-1 */
|
||||
++current;
|
||||
|
||||
/* display header if we're here for the first time */
|
||||
if (current == 1) {
|
||||
set_progress_header(gettext("Mounting ZFS filesystems"));
|
||||
|
||||
@@ -7735,8 +7735,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
||||
* do not print estimated time if hours_left is more than
|
||||
* 30 days
|
||||
*/
|
||||
(void) printf(gettext(" %s copied out of %s at %s/s, "
|
||||
"%.2f%% done"),
|
||||
(void) printf(gettext(
|
||||
"\t%s copied out of %s at %s/s, %.2f%% done"),
|
||||
examined_buf, total_buf, rate_buf, 100 * fraction_done);
|
||||
if (hours_left < (30 * 24)) {
|
||||
(void) printf(gettext(", %lluh%um to go\n"),
|
||||
@@ -7751,8 +7751,8 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
||||
if (prs->prs_mapping_memory > 0) {
|
||||
char mem_buf[7];
|
||||
zfs_nicenum(prs->prs_mapping_memory, mem_buf, sizeof (mem_buf));
|
||||
(void) printf(gettext(" %s memory used for "
|
||||
"removed device mappings\n"),
|
||||
(void) printf(gettext(
|
||||
"\t%s memory used for removed device mappings\n"),
|
||||
mem_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +248,7 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
|
||||
fflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
|
||||
fflags &= ~(DMU_BACKUP_FEATURE_DEDUP |
|
||||
DMU_BACKUP_FEATURE_DEDUPPROPS);
|
||||
/* cppcheck-suppress syntaxError */
|
||||
DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags);
|
||||
|
||||
int sz = drr->drr_payloadlen;
|
||||
|
||||
+2
-2
@@ -132,7 +132,7 @@
|
||||
#include <libnvpair.h>
|
||||
#include <libzutil.h>
|
||||
#include <sys/crypto/icp.h>
|
||||
#ifdef __GLIBC__
|
||||
#if (__GLIBC__ && !__UCLIBC__)
|
||||
#include <execinfo.h> /* for backtrace() */
|
||||
#endif
|
||||
|
||||
@@ -556,7 +556,7 @@ dump_debug_buffer(void)
|
||||
static void sig_handler(int signo)
|
||||
{
|
||||
struct sigaction action;
|
||||
#ifdef __GLIBC__ /* backtrace() is a GNU extension */
|
||||
#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
|
||||
int nptrs;
|
||||
void *buffer[BACKTRACE_SZ];
|
||||
|
||||
|
||||
@@ -369,6 +369,33 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.12 API,
|
||||
dnl #
|
||||
dnl # The Linux 5.12 kernel updated struct bio to create a new bi_bdev member
|
||||
dnl # and bio->bi_disk was moved to bio->bi_bdev->bd_disk
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK], [
|
||||
ZFS_LINUX_TEST_SRC([bio_bdev_disk], [
|
||||
#include <linux/blk_types.h>
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct bio *b = NULL;
|
||||
struct gendisk *d = b->bi_bdev->bd_disk;
|
||||
blk_register_queue(d);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BDEV_DISK], [
|
||||
AC_MSG_CHECKING([whether bio->bi_bdev->bd_disk exists])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bdev_disk], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BDEV_DISK, 1, [bio->bi_bdev->bd_disk exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
||||
ZFS_AC_KERNEL_SRC_REQ
|
||||
ZFS_AC_KERNEL_SRC_BIO_OPS
|
||||
@@ -379,6 +406,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
||||
ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_SRC_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||
@@ -400,4 +428,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||
ZFS_AC_KERNEL_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_BIO_BDEV_DISK
|
||||
])
|
||||
|
||||
@@ -2,6 +2,17 @@ dnl #
|
||||
dnl # Check for generic io accounting interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||
ZFS_LINUX_TEST_SRC([disk_io_acct], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct gendisk *disk = NULL;
|
||||
struct bio *bio = NULL;
|
||||
unsigned long start_time;
|
||||
|
||||
start_time = disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio));
|
||||
disk_end_io_acct(disk, bio_op(bio), start_time);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_io_acct], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
@@ -39,48 +50,62 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
||||
dnl #
|
||||
dnl # 5.7 API,
|
||||
dnl # 5.12 API,
|
||||
dnl #
|
||||
dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
|
||||
dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported
|
||||
dnl # so use disk_start_io_acct() and disk_end_io_acct() instead
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
|
||||
AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
|
||||
ZFS_LINUX_TEST_RESULT([disk_io_acct], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
|
||||
AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.14 API,
|
||||
dnl # 5.7 API,
|
||||
dnl #
|
||||
dnl # generic_start_io_acct/generic_end_io_acct now require
|
||||
dnl # request_queue to be provided. No functional changes,
|
||||
dnl # but preparation for inflight accounting.
|
||||
dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
||||
[generic_start_io_acct], [block/bio.c], [
|
||||
AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
||||
[generic_*_io_acct() 4 arg available])
|
||||
AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.19 API addition
|
||||
dnl # 4.14 API,
|
||||
dnl #
|
||||
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||
dnl # iostat counters without generic_make_request().
|
||||
dnl # generic_start_io_acct/generic_end_io_acct now require
|
||||
dnl # request_queue to be provided. No functional changes,
|
||||
dnl # but preparation for inflight accounting.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether generic_*_io_acct wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||
AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
||||
[generic_start_io_acct], [block/bio.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||
[generic_*_io_acct() 3 arg available])
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
||||
[generic_*_io_acct() 4 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.19 API addition
|
||||
dnl #
|
||||
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||
dnl # iostat counters without generic_make_request().
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether generic_*_io_acct wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||
[generic_start_io_acct], [block/bio.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||
[generic_*_io_acct() 3 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
@@ -228,6 +228,7 @@ AC_CONFIG_FILES([
|
||||
tests/zfs-tests/cmd/readmmap/Makefile
|
||||
tests/zfs-tests/cmd/rename_dir/Makefile
|
||||
tests/zfs-tests/cmd/rm_lnkcnt_zero_file/Makefile
|
||||
tests/zfs-tests/cmd/send_doall/Makefile
|
||||
tests/zfs-tests/cmd/stride_dd/Makefile
|
||||
tests/zfs-tests/cmd/threadsappend/Makefile
|
||||
tests/zfs-tests/cmd/user_ns_exec/Makefile
|
||||
|
||||
@@ -59,4 +59,12 @@ echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysr
|
||||
[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
|
||||
ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
|
||||
|
||||
|
||||
[ -d "$GENERATOR_DIR"/dracut-pre-mount.service.d ] || mkdir "$GENERATOR_DIR"/dracut-pre-mount.service.d
|
||||
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "After=zfs-import.target"
|
||||
} > "$GENERATOR_DIR"/dracut-pre-mount.service.d/zfs-enhancement.conf
|
||||
|
||||
echo "zfs-generator: finished" >> /dev/kmsg
|
||||
|
||||
@@ -8,7 +8,7 @@ After=cryptsetup.target
|
||||
After=multipathd.target
|
||||
After=systemd-remount-fs.service
|
||||
Before=zfs-import.target
|
||||
ConditionPathExists=@sysconfdir@/zfs/zpool.cache
|
||||
ConditionFileNotEmpty=@sysconfdir@/zfs/zpool.cache
|
||||
ConditionPathIsDirectory=/sys/module/zfs
|
||||
|
||||
[Service]
|
||||
|
||||
@@ -7,7 +7,7 @@ After=systemd-udev-settle.service
|
||||
After=cryptsetup.target
|
||||
After=multipathd.target
|
||||
Before=zfs-import.target
|
||||
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
||||
ConditionFileNotEmpty=!@sysconfdir@/zfs/zpool.cache
|
||||
ConditionPathIsDirectory=/sys/module/zfs
|
||||
|
||||
[Service]
|
||||
|
||||
@@ -520,7 +520,9 @@ blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)),
|
||||
struct gendisk *disk __attribute__((unused)),
|
||||
int rw __attribute__((unused)), struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_BIO_IO_ACCT)
|
||||
#if defined(HAVE_DISK_IO_ACCT)
|
||||
return (disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio)));
|
||||
#elif defined(HAVE_BIO_IO_ACCT)
|
||||
return (bio_start_io_acct(bio));
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||
unsigned long start_time = jiffies;
|
||||
@@ -541,7 +543,9 @@ blk_generic_end_io_acct(struct request_queue *q __attribute__((unused)),
|
||||
struct gendisk *disk __attribute__((unused)),
|
||||
int rw __attribute__((unused)), struct bio *bio, unsigned long start_time)
|
||||
{
|
||||
#if defined(HAVE_BIO_IO_ACCT)
|
||||
#if defined(HAVE_DISK_IO_ACCT)
|
||||
disk_end_io_acct(disk, bio_op(bio), start_time);
|
||||
#elif defined(HAVE_BIO_IO_ACCT)
|
||||
bio_end_io_acct(bio, start_time);
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||
generic_end_io_acct(rw, &disk->part0, start_time);
|
||||
|
||||
@@ -110,6 +110,7 @@ COMMON_H = \
|
||||
zfs_fuid.h \
|
||||
zfs_project.h \
|
||||
zfs_quota.h \
|
||||
zfs_racct.h \
|
||||
zfs_ratelimit.h \
|
||||
zfs_refcount.h \
|
||||
zfs_rlock.h \
|
||||
|
||||
@@ -39,6 +39,7 @@ redact_block_get_size(redact_block_phys_t *rbp)
|
||||
static inline void
|
||||
redact_block_set_size(redact_block_phys_t *rbp, uint64_t size)
|
||||
{
|
||||
/* cppcheck-suppress syntaxError */
|
||||
BF64_SET_SB((rbp)->rbp_size_count, 48, 16, SPA_MINBLOCKSHIFT, 0, size);
|
||||
}
|
||||
|
||||
@@ -51,6 +52,7 @@ redact_block_get_count(redact_block_phys_t *rbp)
|
||||
static inline void
|
||||
redact_block_set_count(redact_block_phys_t *rbp, uint64_t count)
|
||||
{
|
||||
/* cppcheck-suppress syntaxError */
|
||||
BF64_SET_SB((rbp)->rbp_size_count, 0, 48, 0, 1, count);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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 http://www.opensolaris.org/os/licensing.
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Portions Copyright 2021 iXsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_ZFS_RACCT_H
|
||||
#define _SYS_ZFS_RACCT_H
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
|
||||
/*
|
||||
* Platform-dependent resource accounting hooks
|
||||
*/
|
||||
void zfs_racct_read(uint64_t size, uint64_t iops);
|
||||
void zfs_racct_write(uint64_t size, uint64_t iops);
|
||||
|
||||
#endif /* _SYS_ZFS_RACCT_H */
|
||||
@@ -532,6 +532,8 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
|
||||
|
||||
break;
|
||||
case ZFS_KEYLOCATION_URI:
|
||||
ret = ENOTSUP;
|
||||
|
||||
for (handler = uri_handlers; handler->zuh_scheme != NULL;
|
||||
handler++) {
|
||||
if (strcmp(handler->zuh_scheme, uri_scheme) != 0)
|
||||
@@ -544,9 +546,11 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
|
||||
break;
|
||||
}
|
||||
|
||||
ret = ENOTSUP;
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"URI scheme is not supported"));
|
||||
if (ret == ENOTSUP) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"URI scheme is not supported"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -321,6 +321,15 @@ send_iterate_snap(zfs_handle_t *zhp, void *arg)
|
||||
}
|
||||
|
||||
if (!sd->recursive) {
|
||||
|
||||
/*
|
||||
* To allow a doall stream to work properly
|
||||
* with a NULL fromsnap
|
||||
*/
|
||||
if (sd->doall && sd->fromsnap == NULL && !sd->seenfrom) {
|
||||
sd->seenfrom = B_TRUE;
|
||||
}
|
||||
|
||||
if (!sd->seenfrom && isfromsnap) {
|
||||
sd->seenfrom = B_TRUE;
|
||||
zfs_close(zhp);
|
||||
|
||||
@@ -161,6 +161,7 @@ KERNEL_C = \
|
||||
zfs_debug.c \
|
||||
zfs_fm.c \
|
||||
zfs_fuid.c \
|
||||
zfs_racct.c \
|
||||
zfs_sa.c \
|
||||
zfs_znode.c \
|
||||
zfs_ratelimit.c \
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ set_global_var(char *arg)
|
||||
char *varname = arg, *varval;
|
||||
u_longlong_t val;
|
||||
|
||||
#ifndef _LITTLE_ENDIAN
|
||||
#ifndef _ZFS_LITTLE_ENDIAN
|
||||
/*
|
||||
* On big endian systems changing a 64-bit variable would set the high
|
||||
* 32 bits instead of the low 32 bits, which could cause unexpected
|
||||
|
||||
@@ -1186,7 +1186,7 @@ amount of memory. When the limit is exceeded, the ioctl fails with EINVAL and a
|
||||
description of the error is sent to the zfs-dbgmsg log. This parameter should
|
||||
not need to be touched under normal circumstances. On FreeBSD, the default is
|
||||
based on the system limit on user wired memory. On Linux, the default is
|
||||
\fBKMALLOC_MAX_SIZE\fR .
|
||||
\fB128MB\fR.
|
||||
.sp
|
||||
Default value: \fB0\fR (kernel decides)
|
||||
.RE
|
||||
|
||||
+8
-3
@@ -63,12 +63,17 @@ If specified, you can list property information by the absolute pathname or the
|
||||
relative pathname.
|
||||
By default, all file systems and volumes are displayed.
|
||||
Snapshots are displayed if the
|
||||
.Sy listsnaps
|
||||
property is
|
||||
.Sy listsnapshots
|
||||
pool property is
|
||||
.Sy on
|
||||
.Po the default is
|
||||
.Sy off
|
||||
.Pc .
|
||||
.Pc ,
|
||||
or if the
|
||||
.Fl t Sy snapshot
|
||||
or
|
||||
.Fl t Sy all
|
||||
options are specified.
|
||||
The following fields are displayed:
|
||||
.Sy name Ns \&, Sy used Ns \&, Sy available Ns \&, Sy referenced Ns \&, Sy mountpoint Ns .
|
||||
.Bl -tag -width "-H"
|
||||
|
||||
@@ -261,6 +261,16 @@ causes the property to be inherited by all descendant datasets, as through
|
||||
was run on any descendant datasets that have this property set on the
|
||||
sending system.
|
||||
.Pp
|
||||
If the send stream was sent with
|
||||
.Fl c
|
||||
then overriding the
|
||||
.Sy compression
|
||||
property will have no affect on received data but the
|
||||
.Sy compression
|
||||
property will be set. To have the data recompressed on receive remove the
|
||||
.Fl c
|
||||
flag from the send stream.
|
||||
.Pp
|
||||
Any editable property can be set at receive time. Set-once properties bound
|
||||
to the received data, such as
|
||||
.Sy normalization
|
||||
|
||||
+6
-1
@@ -189,7 +189,12 @@ feature is enabled on the sending system but the
|
||||
option is not supplied in conjunction with
|
||||
.Fl c ,
|
||||
then the data will be decompressed before sending so it can be split into
|
||||
smaller block sizes.
|
||||
smaller block sizes. Streams sent with
|
||||
.Fl c
|
||||
will not have their data recompressed on the receiver side using
|
||||
.Fl o compress=value.
|
||||
The data will stay compressed as it was from the sender. The new compression
|
||||
property will be set for future data.
|
||||
.It Fl w, -raw
|
||||
For encrypted datasets, send data exactly as it exists on disk. This allows
|
||||
backups to be taken even if encryption keys are not currently loaded. The
|
||||
|
||||
@@ -153,6 +153,7 @@ SRCS+= abd_os.c \
|
||||
zfs_dir.c \
|
||||
zfs_ioctl_compat.c \
|
||||
zfs_ioctl_os.c \
|
||||
zfs_racct.c \
|
||||
zfs_vfsops.c \
|
||||
zfs_vnops_os.c \
|
||||
zfs_znode.c \
|
||||
|
||||
@@ -293,8 +293,19 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp,
|
||||
error = ENOTSUP;
|
||||
goto bad;
|
||||
}
|
||||
error = crypto_newsession(&sessp->fs_sid, &csp,
|
||||
CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE);
|
||||
|
||||
/*
|
||||
* Disable the use of hardware drivers on FreeBSD 13 and later since
|
||||
* common crypto offload drivers impose constraints on AES-GCM AAD
|
||||
* lengths that make them unusable for ZFS, and we currently do not have
|
||||
* a mechanism to fall back to a software driver for requests not
|
||||
* handled by a hardware driver.
|
||||
*
|
||||
* On 12 we continue to permit the use of hardware drivers since
|
||||
* CPU-accelerated drivers such as aesni(4) register themselves as
|
||||
* hardware drivers.
|
||||
*/
|
||||
error = crypto_newsession(&sessp->fs_sid, &csp, CRYPTOCAP_F_SOFTWARE);
|
||||
mtx_init(&sessp->fs_lock, "FreeBSD Cryptographic Session Lock",
|
||||
NULL, MTX_DEF);
|
||||
crypt_sessions++;
|
||||
|
||||
@@ -319,7 +319,7 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count,
|
||||
break;
|
||||
}
|
||||
ASSERT(m->dirty == 0);
|
||||
ASSERT(!pmap_page_is_mapped(m));
|
||||
ASSERT(!pmap_page_is_write_mapped(m));
|
||||
|
||||
ASSERT(db->db_size > PAGE_SIZE);
|
||||
bufoff = IDX_TO_OFF(m->pindex) % db->db_size;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2021 iXsystems, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_racct.h>
|
||||
#include <sys/racct.h>
|
||||
|
||||
void
|
||||
zfs_racct_read(uint64_t size, uint64_t iops)
|
||||
{
|
||||
curthread->td_ru.ru_inblock += iops;
|
||||
#ifdef RACCT
|
||||
if (racct_enable) {
|
||||
PROC_LOCK(curproc);
|
||||
racct_add_force(curproc, RACCT_READBPS, size);
|
||||
racct_add_force(curproc, RACCT_READIOPS, iops);
|
||||
PROC_UNLOCK(curproc);
|
||||
}
|
||||
#endif /* RACCT */
|
||||
}
|
||||
|
||||
void
|
||||
zfs_racct_write(uint64_t size, uint64_t iops)
|
||||
{
|
||||
curthread->td_ru.ru_oublock += iops;
|
||||
#ifdef RACCT
|
||||
if (racct_enable) {
|
||||
PROC_LOCK(curproc);
|
||||
racct_add_force(curproc, RACCT_WRITEBPS, size);
|
||||
racct_add_force(curproc, RACCT_WRITEIOPS, iops);
|
||||
PROC_UNLOCK(curproc);
|
||||
}
|
||||
#endif /* RACCT */
|
||||
}
|
||||
@@ -22,6 +22,7 @@ $(MODULE)-objs += ../os/linux/zfs/zfs_debug.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_dir.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_file_os.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_ioctl_os.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_racct.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_sysfs.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_uio.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/zfs_vfsops.o
|
||||
|
||||
@@ -499,7 +499,11 @@ vdev_blkg_tryget(struct blkcg_gq *blkg)
|
||||
static inline void
|
||||
vdev_bio_associate_blkg(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_BIO_BDEV_DISK)
|
||||
struct request_queue *q = bio->bi_bdev->bd_disk->queue;
|
||||
#else
|
||||
struct request_queue *q = bio->bi_disk->queue;
|
||||
#endif
|
||||
|
||||
ASSERT3P(q, !=, NULL);
|
||||
ASSERT3P(bio->bi_blkg, ==, NULL);
|
||||
|
||||
@@ -2214,13 +2214,11 @@ zfs_zaccess_dataset_check(znode_t *zp, uint32_t v4_mode)
|
||||
}
|
||||
|
||||
/*
|
||||
* Only check for READONLY on non-directories.
|
||||
* Intentionally allow ZFS_READONLY through here.
|
||||
* See zfs_zaccess_common().
|
||||
*/
|
||||
if ((v4_mode & WRITE_MASK_DATA) &&
|
||||
((!S_ISDIR(ZTOI(zp)->i_mode) &&
|
||||
(zp->z_pflags & (ZFS_READONLY | ZFS_IMMUTABLE))) ||
|
||||
(S_ISDIR(ZTOI(zp)->i_mode) &&
|
||||
(zp->z_pflags & ZFS_IMMUTABLE)))) {
|
||||
(zp->z_pflags & ZFS_IMMUTABLE)) {
|
||||
return (SET_ERROR(EPERM));
|
||||
}
|
||||
|
||||
@@ -2434,6 +2432,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: ZFS_READONLY represents the "DOS R/O" attribute.
|
||||
* When that flag is set, we should behave as if write access
|
||||
* were not granted by anything in the ACL. In particular:
|
||||
* We _must_ allow writes after opening the file r/w, then
|
||||
* setting the DOS R/O attribute, and writing some more.
|
||||
* (Similar to how you can write after fchmod(fd, 0444).)
|
||||
*
|
||||
* Therefore ZFS_READONLY is ignored in the dataset check
|
||||
* above, and checked here as if part of the ACL check.
|
||||
* Also note: DOS R/O is ignored for directories.
|
||||
*/
|
||||
if ((v4_mode & WRITE_MASK_DATA) &&
|
||||
S_ISDIR(ZTOI(zp)->i_mode) &&
|
||||
(zp->z_pflags & ZFS_READONLY)) {
|
||||
return (SET_ERROR(EPERM));
|
||||
}
|
||||
|
||||
return (zfs_zaccess_aces_check(zp, working_mode, B_FALSE, cr));
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ zfs_max_nvlist_src_size_os(void)
|
||||
if (zfs_max_nvlist_src_size != 0)
|
||||
return (zfs_max_nvlist_src_size);
|
||||
|
||||
return (KMALLOC_MAX_SIZE);
|
||||
return (MIN(ptob(zfs_totalram_pages) / 4, 128 * 1024 * 1024));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2021 iXsystems, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_racct.h>
|
||||
|
||||
void
|
||||
zfs_racct_read(uint64_t size, uint64_t iops)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
zfs_racct_write(uint64_t size, uint64_t iops)
|
||||
{
|
||||
}
|
||||
@@ -1399,6 +1399,7 @@ zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf,
|
||||
nr_src = 1;
|
||||
nr_dst = 0;
|
||||
}
|
||||
bzero(dst, datalen);
|
||||
|
||||
/* find the start and end record of the log block */
|
||||
zilc = (zil_chain_t *)src;
|
||||
|
||||
@@ -307,7 +307,11 @@ zvol_request(struct request_queue *q, struct bio *bio)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS
|
||||
#if defined(HAVE_BIO_BDEV_DISK)
|
||||
struct request_queue *q = bio->bi_bdev->bd_disk->queue;
|
||||
#else
|
||||
struct request_queue *q = bio->bi_disk->queue;
|
||||
#endif
|
||||
#endif
|
||||
zvol_state_t *zv = q->queuedata;
|
||||
fstrans_cookie_t cookie = spl_fstrans_mark();
|
||||
|
||||
@@ -417,7 +417,7 @@ zfs_prop_init(void)
|
||||
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
||||
"on | off | lzjb | gzip | gzip-[1-9] | zle | lz4 | "
|
||||
"zstd | zstd-[1-19] | "
|
||||
"zstd-fast-[1-10,20,30,40,50,60,70,80,90,100,500,1000]",
|
||||
"zstd-fast | zstd-fast-[1-10,20,30,40,50,60,70,80,90,100,500,1000]",
|
||||
"COMPRESS", compress_table);
|
||||
zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
|
||||
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
||||
|
||||
@@ -308,6 +308,7 @@
|
||||
#include <sys/aggsum.h>
|
||||
#include <cityhash.h>
|
||||
#include <sys/vdev_trim.h>
|
||||
#include <sys/zfs_racct.h>
|
||||
#include <sys/zstd/zstd.h>
|
||||
|
||||
#ifndef _KERNEL
|
||||
@@ -6180,6 +6181,7 @@ top:
|
||||
ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr),
|
||||
demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data,
|
||||
metadata, misses);
|
||||
zfs_racct_read(size, 1);
|
||||
}
|
||||
|
||||
if (vd != NULL && l2arc_ndev != 0 && !(l2arc_norw && devw)) {
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <sys/zfeature.h>
|
||||
#include <sys/abd.h>
|
||||
#include <sys/trace_zfs.h>
|
||||
#include <sys/zfs_racct.h>
|
||||
#include <sys/zfs_rlock.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/vmsystm.h>
|
||||
@@ -548,6 +549,9 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
|
||||
dbp[i] = &db->db;
|
||||
}
|
||||
|
||||
if (!read)
|
||||
zfs_racct_write(length, nblks);
|
||||
|
||||
if ((flags & DMU_READ_NO_PREFETCH) == 0 &&
|
||||
DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) {
|
||||
dmu_zfetch(&dn->dn_zfetch, blkid, nblks,
|
||||
@@ -1587,6 +1591,7 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf,
|
||||
* same size as the dbuf, and the dbuf is not metadata.
|
||||
*/
|
||||
if (offset == db->db.db_offset && blksz == db->db.db_size) {
|
||||
zfs_racct_write(blksz, 1);
|
||||
dbuf_assign_arcbuf(db, buf, tx);
|
||||
dbuf_rele(db, FTAG);
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -2317,7 +2317,7 @@ vdev_hold(vdev_t *vd)
|
||||
for (int c = 0; c < vd->vdev_children; c++)
|
||||
vdev_hold(vd->vdev_child[c]);
|
||||
|
||||
if (vd->vdev_ops->vdev_op_leaf)
|
||||
if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_hold != NULL)
|
||||
vd->vdev_ops->vdev_op_hold(vd);
|
||||
}
|
||||
|
||||
@@ -2328,7 +2328,7 @@ vdev_rele(vdev_t *vd)
|
||||
for (int c = 0; c < vd->vdev_children; c++)
|
||||
vdev_rele(vd->vdev_child[c]);
|
||||
|
||||
if (vd->vdev_ops->vdev_op_leaf)
|
||||
if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_rele != NULL)
|
||||
vd->vdev_ops->vdev_op_rele(vd);
|
||||
}
|
||||
|
||||
|
||||
@@ -258,9 +258,11 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
}
|
||||
|
||||
/*
|
||||
* If immutable or not appending then return EPERM
|
||||
* If immutable or not appending then return EPERM.
|
||||
* Intentionally allow ZFS_READONLY through here.
|
||||
* See zfs_zaccess_common()
|
||||
*/
|
||||
if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) ||
|
||||
if ((zp->z_pflags & ZFS_IMMUTABLE) ||
|
||||
((zp->z_pflags & ZFS_APPENDONLY) && !(ioflag & O_APPEND) &&
|
||||
(uio->uio_loffset < zp->z_size))) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
@@ -528,6 +530,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
((zp->z_mode & S_ISUID) != 0 && uid == 0)) != 0) {
|
||||
uint64_t newmode;
|
||||
zp->z_mode &= ~(S_ISUID | S_ISGID);
|
||||
newmode = zp->z_mode;
|
||||
(void) sa_update(zp->z_sa_hdl, SA_ZPL_MODE(zfsvfs),
|
||||
(void *)&newmode, sizeof (uint64_t), tx);
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ tests = ['recv_dedup', 'recv_dedup_encrypted_zvol', 'rsend_001_pos',
|
||||
'send_freeobjects', 'send_realloc_files',
|
||||
'send_realloc_encrypted_files', 'send_spill_block', 'send_holds',
|
||||
'send_hole_birth', 'send_mixed_raw', 'send-wR_encrypted_zvol',
|
||||
'send_partial_dataset', 'send_invalid']
|
||||
'send_partial_dataset', 'send_invalid', 'send_doall']
|
||||
tags = ['functional', 'rsend']
|
||||
|
||||
[tests/functional/scrub_mirror]
|
||||
|
||||
@@ -127,6 +127,11 @@ trim_reason = 'DISKS must support discard (TRIM/UNMAP)'
|
||||
#
|
||||
na_reason = "Not applicable"
|
||||
|
||||
#
|
||||
# Some test cases doesn't have all requirements to run on Github actions CI.
|
||||
#
|
||||
ci_reason = 'CI runner doesn\'t have all requirements'
|
||||
|
||||
summary = {
|
||||
'total': float(0),
|
||||
'passed': float(0),
|
||||
@@ -274,6 +279,35 @@ elif sys.platform.startswith('linux'):
|
||||
})
|
||||
|
||||
|
||||
# Not all Github actions runners have scsi_debug module, so we may skip
|
||||
# some tests which use it.
|
||||
if os.environ.get('CI') == 'true':
|
||||
known.update({
|
||||
'cli_root/zpool_expand/zpool_expand_001_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_expand/zpool_expand_003_neg': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_expand/zpool_expand_005_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/setup': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_001_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_002_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_003_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_004_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_005_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_006_neg': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_reopen/zpool_reopen_007_pos': ['SKIP', ci_reason],
|
||||
'cli_root/zpool_split/zpool_split_wholedisk': ['SKIP', ci_reason],
|
||||
'fault/auto_offline_001_pos': ['SKIP', ci_reason],
|
||||
'fault/auto_online_001_pos': ['SKIP', ci_reason],
|
||||
'fault/auto_replace_001_pos': ['SKIP', ci_reason],
|
||||
'fault/auto_spare_ashift': ['SKIP', ci_reason],
|
||||
'fault/auto_spare_shared': ['SKIP', ci_reason],
|
||||
'procfs/pool_state': ['SKIP', ci_reason],
|
||||
})
|
||||
|
||||
maybe.update({
|
||||
'events/events_002_pos': ['FAIL', '11546'],
|
||||
})
|
||||
|
||||
|
||||
def usage(s):
|
||||
print(s)
|
||||
sys.exit(1)
|
||||
|
||||
@@ -24,6 +24,7 @@ SUBDIRS = \
|
||||
readmmap \
|
||||
rename_dir \
|
||||
rm_lnkcnt_zero_file \
|
||||
send_doall \
|
||||
stride_dd \
|
||||
threadsappend
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/send_doall
|
||||
@@ -0,0 +1,11 @@
|
||||
include $(top_srcdir)/config/Rules.am
|
||||
|
||||
pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
|
||||
|
||||
pkgexec_PROGRAMS = send_doall
|
||||
|
||||
send_doall_SOURCES = send_doall.c
|
||||
send_doall_LDADD = \
|
||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||
$(abs_top_builddir)/lib/libzfs/libzfs.la \
|
||||
$(abs_top_builddir)/lib/libnvpair/libnvpair.la
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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 http://www.opensolaris.org/os/licensing.
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* Portions Copyright 2020 iXsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test a corner case : a "doall" send without children datasets.
|
||||
*/
|
||||
|
||||
#include <libzfs.h>
|
||||
#include <libzfs_core.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sysexits.h>
|
||||
#include <err.h>
|
||||
|
||||
static void
|
||||
usage(const char *name)
|
||||
{
|
||||
fprintf(stderr, "usage: %s snap\n", name);
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char const * const argv[])
|
||||
{
|
||||
sendflags_t flags = { 0 };
|
||||
libzfs_handle_t *zhdl;
|
||||
zfs_handle_t *zhp;
|
||||
const char *tofull, *fsname, *tosnap, *p;
|
||||
int error;
|
||||
|
||||
if (argc != 2)
|
||||
usage(argv[0]);
|
||||
|
||||
tofull = argv[1];
|
||||
|
||||
p = strchr(tofull, '@');
|
||||
if (p == NULL)
|
||||
usage(argv[0]);
|
||||
tosnap = p + 1;
|
||||
|
||||
fsname = strndup(tofull, p - tofull);
|
||||
|
||||
zhdl = libzfs_init();
|
||||
if (zhdl == NULL)
|
||||
errx(EX_OSERR, "libzfs_init(): %s", libzfs_error_init(errno));
|
||||
|
||||
zhp = zfs_open(zhdl, fsname, ZFS_TYPE_FILESYSTEM);
|
||||
if (zhp == NULL)
|
||||
err(EX_OSERR, "zfs_open(\"%s\")", fsname);
|
||||
|
||||
flags.doall = B_TRUE;
|
||||
|
||||
error = zfs_send(zhp, NULL, tosnap, &flags,
|
||||
STDOUT_FILENO, NULL, NULL, NULL);
|
||||
|
||||
zfs_close(zhp);
|
||||
|
||||
libzfs_fini(zhdl);
|
||||
free((void *)fsname);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -44,11 +44,9 @@
|
||||
#include <sys/time.h>
|
||||
#include <linux/limits.h>
|
||||
|
||||
extern char *program_invocation_short_name;
|
||||
|
||||
#define ERROR(fmt, ...) \
|
||||
fprintf(stderr, "%s: %s:%d: %s: " fmt "\n", \
|
||||
program_invocation_short_name, __FILE__, __LINE__, \
|
||||
fprintf(stderr, "xattrtest: %s:%d: %s: " fmt "\n", \
|
||||
__FILE__, __LINE__, \
|
||||
__func__, ## __VA_ARGS__);
|
||||
|
||||
static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRko:";
|
||||
|
||||
@@ -215,6 +215,7 @@ export ZFSTEST_FILES='badsend
|
||||
readmmap
|
||||
rename_dir
|
||||
rm_lnkcnt_zero_file
|
||||
send_doall
|
||||
threadsappend
|
||||
user_ns_exec
|
||||
xattrtest
|
||||
|
||||
@@ -53,7 +53,8 @@ dist_pkgdata_SCRIPTS = \
|
||||
send_hole_birth.ksh \
|
||||
send_invalid.ksh \
|
||||
send_mixed_raw.ksh \
|
||||
send-wR_encrypted_zvol.ksh
|
||||
send-wR_encrypted_zvol.ksh \
|
||||
send_doall.ksh
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
dedup.zsend.bz2 \
|
||||
@@ -62,3 +63,4 @@ dist_pkgdata_DATA = \
|
||||
fs.tar.gz \
|
||||
rsend.cfg \
|
||||
rsend.kshlib
|
||||
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
#!/bin/ksh
|
||||
|
||||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
# You may only use this file in accordance with the terms of version
|
||||
# 1.0 of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2019 by Lawrence Livermore National Security, LLC.
|
||||
#
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
. $STF_SUITE/tests/functional/rsend/rsend.kshlib
|
||||
|
||||
#
|
||||
# Description:
|
||||
# Verify send_doall stream is properly received
|
||||
#
|
||||
# Strategy:
|
||||
# 1) Create a set of snapshots.
|
||||
# 2) Send these snapshots (from origin to the last one) to a file using send_doall.
|
||||
# 3) Receive the file to newfs to test if the stream is properly handled.
|
||||
#
|
||||
|
||||
verify_runnable "both"
|
||||
|
||||
log_assert "Verify send_doall stream is correct"
|
||||
|
||||
function cleanup
|
||||
{
|
||||
rm -f $BACKDIR/fs@*
|
||||
destroy_dataset $POOL/fs "-rR"
|
||||
destroy_dataset $POOL/newfs "-rR"
|
||||
}
|
||||
|
||||
log_onexit cleanup
|
||||
|
||||
log_must zfs create $POOL/fs
|
||||
log_must zfs create $POOL/fs/child
|
||||
|
||||
# Create 3 files and a snapshot between each file creation.
|
||||
for i in {1..3}; do
|
||||
file="/$POOL/fs/file$i"
|
||||
log_must mkfile 16384 $file
|
||||
|
||||
file="/$POOL/fs/child/file$i"
|
||||
log_must mkfile 16384 $file
|
||||
|
||||
log_must zfs snapshot -r $POOL/fs@snap$i
|
||||
done
|
||||
|
||||
# Snapshot the pool and send it to the new dataset.
|
||||
log_must eval "send_doall $POOL/fs@snap3 >$BACKDIR/fs@snap3"
|
||||
log_must eval "zfs recv $POOL/newfs < $BACKDIR/fs@snap3"
|
||||
|
||||
zfs list $POOL/newfs/child
|
||||
if [[ $? -eq 0 ]]; then
|
||||
log_fail "Children dataset should not have been received"
|
||||
fi
|
||||
|
||||
log_pass "Verify send_doall stream is correct"
|
||||
Reference in New Issue
Block a user