Compare commits

..

1 Commits

Author SHA1 Message Date
Tony Hutter 9f5f866266 Tag zfs-2.0.3
META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2021-02-10 12:20:59 -08:00
44 changed files with 61 additions and 493 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
Meta: 1
Name: zfs
Branch: 1.0
Version: 2.0.4
Version: 2.0.3
Release: 1
Release-Tags: relext
License: CDDL
Author: OpenZFS
Linux-Maximum: 5.11
Linux-Maximum: 5.10
Linux-Minimum: 3.10
+3
View File
@@ -6790,6 +6790,9 @@ 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"));
+4 -4
View File
@@ -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(
"\t%s copied out of %s at %s/s, %.2f%% done"),
(void) printf(gettext(" %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(
"\t%s memory used for removed device mappings\n"),
(void) printf(gettext(" %s memory used for "
"removed device mappings\n"),
mem_buf);
}
}
-1
View File
@@ -248,7 +248,6 @@ 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
View File
@@ -132,7 +132,7 @@
#include <libnvpair.h>
#include <libzutil.h>
#include <sys/crypto/icp.h>
#if (__GLIBC__ && !__UCLIBC__)
#ifdef __GLIBC__
#include <execinfo.h> /* for backtrace() */
#endif
@@ -556,7 +556,7 @@ dump_debug_buffer(void)
static void sig_handler(int signo)
{
struct sigaction action;
#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
#ifdef __GLIBC__ /* backtrace() is a GNU extension */
int nptrs;
void *buffer[BACKTRACE_SZ];
-29
View File
@@ -369,33 +369,6 @@ 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
@@ -406,7 +379,6 @@ 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], [
@@ -428,5 +400,4 @@ 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
])
+22 -47
View File
@@ -2,17 +2,6 @@ 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>
], [
@@ -50,62 +39,48 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
dnl #
dnl # 5.12 API,
dnl # 5.7 API,
dnl #
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 # Added bio_start_io_acct() and bio_end_io_acct() helpers.
dnl #
AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
ZFS_LINUX_TEST_RESULT([disk_io_acct], [
AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
], [
AC_MSG_RESULT(no)
dnl #
dnl # 5.7 API,
dnl # 4.14 API,
dnl #
dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
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 bio_*_io_acct() are available])
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
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_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
[generic_*_io_acct() 4 arg available])
], [
AC_MSG_RESULT(no)
dnl #
dnl # 4.14 API,
dnl # 3.19 API addition
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 # torvalds/linux@394ffa50 allows us to increment
dnl # iostat counters without generic_make_request().
dnl #
AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
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_4ARG, 1,
[generic_*_io_acct() 4 arg available])
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
[generic_*_io_acct() 3 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)
])
])
])
])
-1
View File
@@ -228,7 +228,6 @@ 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
@@ -520,9 +520,7 @@ 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_DISK_IO_ACCT)
return (disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio)));
#elif defined(HAVE_BIO_IO_ACCT)
#if defined(HAVE_BIO_IO_ACCT)
return (bio_start_io_acct(bio));
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
unsigned long start_time = jiffies;
@@ -543,9 +541,7 @@ 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_DISK_IO_ACCT)
disk_end_io_acct(disk, bio_op(bio), start_time);
#elif defined(HAVE_BIO_IO_ACCT)
#if 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);
-1
View File
@@ -110,7 +110,6 @@ COMMON_H = \
zfs_fuid.h \
zfs_project.h \
zfs_quota.h \
zfs_racct.h \
zfs_ratelimit.h \
zfs_refcount.h \
zfs_rlock.h \
-2
View File
@@ -39,7 +39,6 @@ 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);
}
@@ -52,7 +51,6 @@ 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);
}
-37
View File
@@ -1,37 +0,0 @@
/*
* 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 */
+3 -7
View File
@@ -532,8 +532,6 @@ 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)
@@ -546,11 +544,9 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
break;
}
if (ret == ENOTSUP) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"URI scheme is not supported"));
goto error;
}
ret = ENOTSUP;
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"URI scheme is not supported"));
break;
default:
-9
View File
@@ -321,15 +321,6 @@ 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);
-1
View File
@@ -161,7 +161,6 @@ 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
View File
@@ -159,7 +159,7 @@ set_global_var(char *arg)
char *varname = arg, *varval;
u_longlong_t val;
#ifndef _ZFS_LITTLE_ENDIAN
#ifndef _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
+1 -1
View File
@@ -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
\fB128MB\fR.
\fBKMALLOC_MAX_SIZE\fR .
.sp
Default value: \fB0\fR (kernel decides)
.RE
-10
View File
@@ -261,16 +261,6 @@ 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
+1 -6
View File
@@ -189,12 +189,7 @@ 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. 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.
smaller block sizes.
.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
-1
View File
@@ -153,7 +153,6 @@ 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 \
+2 -13
View File
@@ -293,19 +293,8 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp,
error = ENOTSUP;
goto bad;
}
/*
* 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);
error = crypto_newsession(&sessp->fs_sid, &csp,
CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE);
mtx_init(&sessp->fs_lock, "FreeBSD Cryptographic Session Lock",
NULL, MTX_DEF);
crypt_sessions++;
+1 -1
View File
@@ -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_write_mapped(m));
ASSERT(!pmap_page_is_mapped(m));
ASSERT(db->db_size > PAGE_SIZE);
bufoff = IDX_TO_OFF(m->pindex) % db->db_size;
-55
View File
@@ -1,55 +0,0 @@
/*
* 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 */
}
-1
View File
@@ -22,7 +22,6 @@ $(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
-4
View File
@@ -499,11 +499,7 @@ 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);
+5 -21
View File
@@ -2214,11 +2214,13 @@ zfs_zaccess_dataset_check(znode_t *zp, uint32_t v4_mode)
}
/*
* Intentionally allow ZFS_READONLY through here.
* See zfs_zaccess_common().
* Only check for READONLY on non-directories.
*/
if ((v4_mode & WRITE_MASK_DATA) &&
(zp->z_pflags & ZFS_IMMUTABLE)) {
((!S_ISDIR(ZTOI(zp)->i_mode) &&
(zp->z_pflags & (ZFS_READONLY | ZFS_IMMUTABLE))) ||
(S_ISDIR(ZTOI(zp)->i_mode) &&
(zp->z_pflags & ZFS_IMMUTABLE)))) {
return (SET_ERROR(EPERM));
}
@@ -2432,24 +2434,6 @@ 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));
}
+1 -1
View File
@@ -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 (MIN(ptob(zfs_totalram_pages) / 4, 128 * 1024 * 1024));
return (KMALLOC_MAX_SIZE);
}
void
-36
View File
@@ -1,36 +0,0 @@
/*
* 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)
{
}
-1
View File
@@ -1399,7 +1399,6 @@ 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;
-4
View File
@@ -307,11 +307,7 @@ 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();
+1 -1
View File
@@ -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 | zstd-fast-[1-10,20,30,40,50,60,70,80,90,100,500,1000]",
"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,
-2
View File
@@ -308,7 +308,6 @@
#include <sys/aggsum.h>
#include <cityhash.h>
#include <sys/vdev_trim.h>
#include <sys/zfs_racct.h>
#include <sys/zstd/zstd.h>
#ifndef _KERNEL
@@ -6181,7 +6180,6 @@ 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)) {
-5
View File
@@ -52,7 +52,6 @@
#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>
@@ -549,9 +548,6 @@ 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,
@@ -1591,7 +1587,6 @@ 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
View File
@@ -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 && vd->vdev_ops->vdev_op_hold != NULL)
if (vd->vdev_ops->vdev_op_leaf)
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 && vd->vdev_ops->vdev_op_rele != NULL)
if (vd->vdev_ops->vdev_op_leaf)
vd->vdev_ops->vdev_op_rele(vd);
}
+2 -4
View File
@@ -258,11 +258,9 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
}
/*
* If immutable or not appending then return EPERM.
* Intentionally allow ZFS_READONLY through here.
* See zfs_zaccess_common()
* If immutable or not appending then return EPERM
*/
if ((zp->z_pflags & ZFS_IMMUTABLE) ||
if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) ||
((zp->z_pflags & ZFS_APPENDONLY) && !(ioflag & O_APPEND) &&
(uio->uio_loffset < zp->z_size))) {
ZFS_EXIT(zfsvfs);
+1 -1
View File
@@ -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_doall']
'send_partial_dataset', 'send_invalid']
tags = ['functional', 'rsend']
[tests/functional/scrub_mirror]
-1
View File
@@ -24,7 +24,6 @@ SUBDIRS = \
readmmap \
rename_dir \
rm_lnkcnt_zero_file \
send_doall \
stride_dd \
threadsappend
@@ -1 +0,0 @@
/send_doall
@@ -1,11 +0,0 @@
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
@@ -1,87 +0,0 @@
/*
* 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);
}
+4 -2
View File
@@ -44,9 +44,11 @@
#include <sys/time.h>
#include <linux/limits.h>
extern char *program_invocation_short_name;
#define ERROR(fmt, ...) \
fprintf(stderr, "xattrtest: %s:%d: %s: " fmt "\n", \
__FILE__, __LINE__, \
fprintf(stderr, "%s: %s:%d: %s: " fmt "\n", \
program_invocation_short_name, __FILE__, __LINE__, \
__func__, ## __VA_ARGS__);
static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRko:";
-1
View File
@@ -215,7 +215,6 @@ export ZFSTEST_FILES='badsend
readmmap
rename_dir
rm_lnkcnt_zero_file
send_doall
threadsappend
user_ns_exec
xattrtest
@@ -53,8 +53,7 @@ dist_pkgdata_SCRIPTS = \
send_hole_birth.ksh \
send_invalid.ksh \
send_mixed_raw.ksh \
send-wR_encrypted_zvol.ksh \
send_doall.ksh
send-wR_encrypted_zvol.ksh
dist_pkgdata_DATA = \
dedup.zsend.bz2 \
@@ -63,4 +62,3 @@ dist_pkgdata_DATA = \
fs.tar.gz \
rsend.cfg \
rsend.kshlib
@@ -1,67 +0,0 @@
#!/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"