Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-122348 / None / Merge zfs-2.1.12 #137

Merged
merged 58 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
18edf7a
contrib: dracut: fix race with root=zfs:dset when necessities required
nabijaczleweli Mar 28, 2023
a969b1b
Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
tonyhutter Apr 18, 2023
4e49d8e
Values printed by zpool-iostat(8) should be right-aligned
Low-power Apr 18, 2023
e25f913
Tag zfs-2.1.11
tonyhutter Apr 18, 2023
c7db374
Fix buffered/direct/mmap I/O race
behlendorf Feb 23, 2023
4a5950a
Linux: zfs_fillpage() should handle partial pages from end of file
ryao Mar 1, 2023
a68dfdb
Fix "Detach spare vdev in case if resilvering does not happen"
ixhamza Apr 19, 2023
9fe3da9
Improve resilver ETAs
behlendorf Jan 25, 2023
fa28e26
Increase default zfs_scan_vdev_limit to 16MB
behlendorf Jan 24, 2023
cdbe1d6
Increase default zfs_rebuild_vdev_limit to 64MB
behlendorf Jan 24, 2023
33075e4
Allow MMP to bypass waiting for other threads
hawartens Apr 19, 2023
75ec145
zpool import -m also removing spare and cache when log device is missing
ixhamza May 3, 2023
9b17d5a
Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole
dhedberg Jan 23, 2023
ecaf3ea
ZTS: Minor fixes
behlendorf May 9, 2023
7c555fe
pam: Fix "buffer overflow" in pam ZTS tests on F38
tonyhutter May 10, 2023
133faca
Add dmu_tx_hold_append() interface
behlendorf May 9, 2023
b17e472
zdb: consistent xattr output
behlendorf May 8, 2023
c2f0aae
Fix concurrent resilvers initiated at same time
akashb-22 May 24, 2023
e2176f1
Probe vdevs before marking removed
behlendorf May 19, 2023
e97637d
Add the ability to uninitialize
behlendorf May 18, 2023
6ec3abc
Use vmem_zalloc to silence allocation warning
behlendorf Mar 31, 2023
e2a96aa
Storage device expansion "silently" fails on degraded vdev
pcd1193182 Apr 6, 2023
e1b3ab5
ZTS: send-c_volume is flaky
pcd1193182 Apr 19, 2023
c6f6958
ZTS: add snapshot/snapshot_002_pos exception
behlendorf May 8, 2023
848c4b2
ZTS: Annotate additonal flaky test cases
behlendorf Jan 17, 2023
4e24df0
ZTS: Add auto_replace_001_pos to exceptions
behlendorf May 12, 2023
c094b9a
ZTS: Add zpool_resilver_concurrent exception
behlendorf May 26, 2023
30dcdda
Refine special_small_blocks property validation
don-brady May 12, 2023
d1e05c6
FreeBSD: make zfs_vfs_held() definition consistent with declaration
DimitryAndric Apr 21, 2023
aef1324
FreeBSD: fix up EINVAL from getdirentries on .zfs
mjguzik Apr 20, 2023
092021b
FreeBSD: add missing vn state transition for .zfs
mjguzik Apr 20, 2023
45c4b3e
Fix checkstyle warning
behlendorf Apr 26, 2023
f786232
FreeBSD: don't verify recycled vnode for zfs control directory
rob-wing Feb 22, 2023
07a2ba5
FreeBSD: add missing vop_fplookup assignments
mjguzik Apr 24, 2023
435407e
Fix test-runner on FreeBSD
nabijaczleweli Jan 21, 2022
a836cc6
ZTS: threadsappend_001_pos
behlendorf May 30, 2023
671b1af
Fix NULL pointer dereference when doing concurrent 'send' operations
lumigch May 30, 2023
93a99c6
Revert "initramfs: use `mount.zfs` instead of `mount`"
rincebrain May 31, 2023
7d26967
Move zap_attribute_t to the heap in dsl_deadlist_merge
oshogbo Feb 27, 2023
e271cd7
Fix positive ABD size assertion in abd_verify().
amotin Apr 26, 2023
c1b9dc7
Mark TX_COMMIT transaction with TXG_NOTHROTTLE.
amotin Apr 27, 2023
b2ede77
Fix two abd_gang_add_gang() issues.
amotin May 5, 2023
a727848
Remove single parent assertion from zio_nowait().
amotin May 9, 2023
b01a8cc
zil: Don't expect zio_shrink() to succeed.
amotin May 11, 2023
8a315a3
ZIL: Allow to replay blocks of any size.
amotin May 28, 2023
9e5a297
Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously
shaan1337 May 3, 2022
3ad6c16
Linux: use filemap_range_has_page()
behlendorf Feb 14, 2023
35d43ba
Workaround for Linux PowerPC GPL-only cpu_has_feature()
Low-power Mar 10, 2023
04305bb
Linux 6.3 compat: writepage_t first arg struct folio*
youzhongyang Apr 5, 2023
f0aca5f
Linux 6.3 compat: idmapped mount API changes
youzhongyang Apr 10, 2023
d7fb413
Linux 6.3 compat: Fix memcpy "detected field-spanning write" error
youzhongyang Apr 13, 2023
5f125e9
Linux 6.4 compat: reclaimed_slab renamed to reclaimed
youzhongyang May 24, 2023
79f8e62
Silence clang warning of flexible array not at end
youzhongyang Apr 19, 2023
1322f07
Linux 6.3 compat: META (#14930)
behlendorf Jun 5, 2023
dbbc2f9
Fix Clang 15 compilation errors
szubersk Nov 30, 2022
86783d7
Tag zfs-2.1.12
tonyhutter Jun 5, 2023
fa0045a
Merge tag 'zfs-2.1.12'
ixhamza Jun 14, 2023
fa8019f
Bump changelog for 2.1.12
ixhamza Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions META
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Meta: 1
Name: zfs
Branch: 1.0
Version: 2.1.11
Version: 2.1.12
Release: 1
Release-Tags: relext
License: CDDL
Author: OpenZFS
Linux-Maximum: 6.2
Linux-Maximum: 6.3
Linux-Minimum: 3.10
11 changes: 10 additions & 1 deletion cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3102,13 +3102,22 @@ dump_znode_sa_xattr(sa_handle_t *hdl)
(void) printf("\tSA xattrs: %d bytes, %d entries\n\n",
sa_xattr_size, sa_xattr_entries);
while ((elem = nvlist_next_nvpair(sa_xattr, elem)) != NULL) {
boolean_t can_print = !dump_opt['P'];
uchar_t *value;
uint_t cnt, idx;

(void) printf("\t\t%s = ", nvpair_name(elem));
nvpair_value_byte_array(elem, &value, &cnt);

for (idx = 0; idx < cnt; ++idx) {
if (!isprint(value[idx])) {
can_print = B_FALSE;
break;
}
}

for (idx = 0; idx < cnt; ++idx) {
if (isprint(value[idx]))
if (can_print)
(void) putchar(value[idx]);
else
(void) printf("\\%3.3o", value[idx]);
Expand Down
8 changes: 5 additions & 3 deletions cmd/zed/agents/zfs_retire.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,16 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
return;

/* Remove the vdev since device is unplugged */
int remove_status = 0;
if (l2arc || (strcmp(class, "resource.fs.zfs.removed") == 0)) {
int status = zpool_vdev_remove_wanted(zhp, devname);
remove_status = zpool_vdev_remove_wanted(zhp, devname);
fmd_hdl_debug(hdl, "zpool_vdev_remove_wanted '%s'"
", ret:%d", devname, status);
", err:%d", devname, libzfs_errno(zhdl));
}

/* Replace the vdev with a spare if its not a l2arc */
if (!l2arc && (!fmd_prop_get_int32(hdl, "spare_on_remove") ||
if (!l2arc && !remove_status &&
(!fmd_prop_get_int32(hdl, "spare_on_remove") ||
replace_with_spare(hdl, zhp, vdev) == B_FALSE)) {
/* Could not handle with spare */
fmd_hdl_debug(hdl, "no spare for '%s'", devname);
Expand Down
77 changes: 61 additions & 16 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ get_usage(zpool_help_t idx)
case HELP_REOPEN:
return (gettext("\treopen [-n] <pool>\n"));
case HELP_INITIALIZE:
return (gettext("\tinitialize [-c | -s] [-w] <pool> "
return (gettext("\tinitialize [-c | -s | -u] [-w] <pool> "
"[<device> ...]\n"));
case HELP_SCRUB:
return (gettext("\tscrub [-s | -p] [-w] <pool> ...\n"));
Expand Down Expand Up @@ -548,12 +548,13 @@ usage(boolean_t requested)
}

/*
* zpool initialize [-c | -s] [-w] <pool> [<vdev> ...]
* zpool initialize [-c | -s | -u] [-w] <pool> [<vdev> ...]
* Initialize all unused blocks in the specified vdevs, or all vdevs in the pool
* if none specified.
*
* -c Cancel. Ends active initializing.
* -s Suspend. Initializing can then be restarted with no flags.
* -u Uninitialize. Clears initialization state.
* -w Wait. Blocks until initializing has completed.
*/
int
Expand All @@ -569,12 +570,14 @@ zpool_do_initialize(int argc, char **argv)
struct option long_options[] = {
{"cancel", no_argument, NULL, 'c'},
{"suspend", no_argument, NULL, 's'},
{"uninit", no_argument, NULL, 'u'},
{"wait", no_argument, NULL, 'w'},
{0, 0, 0, 0}
};

pool_initialize_func_t cmd_type = POOL_INITIALIZE_START;
while ((c = getopt_long(argc, argv, "csw", long_options, NULL)) != -1) {
while ((c = getopt_long(argc, argv, "csuw", long_options,
NULL)) != -1) {
switch (c) {
case 'c':
if (cmd_type != POOL_INITIALIZE_START &&
Expand All @@ -594,6 +597,15 @@ zpool_do_initialize(int argc, char **argv)
}
cmd_type = POOL_INITIALIZE_SUSPEND;
break;
case 'u':
if (cmd_type != POOL_INITIALIZE_START &&
cmd_type != POOL_INITIALIZE_UNINIT) {
(void) fprintf(stderr, gettext("-u cannot be "
"combined with other options\n"));
usage(B_FALSE);
}
cmd_type = POOL_INITIALIZE_UNINIT;
break;
case 'w':
wait = B_TRUE;
break;
Expand All @@ -620,8 +632,8 @@ zpool_do_initialize(int argc, char **argv)
}

if (wait && (cmd_type != POOL_INITIALIZE_START)) {
(void) fprintf(stderr, gettext("-w cannot be used with -c or "
"-s\n"));
(void) fprintf(stderr, gettext("-w cannot be used with -c, -s"
"or -u\n"));
usage(B_FALSE);
}

Expand Down Expand Up @@ -6926,6 +6938,17 @@ zpool_do_online(int argc, char **argv)
return (1);

for (i = 1; i < argc; i++) {
vdev_state_t oldstate;
boolean_t avail_spare, l2cache;
nvlist_t *tgt = zpool_find_vdev(zhp, argv[i], &avail_spare,
&l2cache, NULL);
if (tgt == NULL) {
ret = 1;
continue;
}
uint_t vsc;
oldstate = ((vdev_stat_t *)fnvlist_lookup_uint64_array(tgt,
ZPOOL_CONFIG_VDEV_STATS, &vsc))->vs_state;
if (zpool_vdev_online(zhp, argv[i], flags, &newstate) == 0) {
if (newstate != VDEV_STATE_HEALTHY) {
(void) printf(gettext("warning: device '%s' "
Expand All @@ -6939,6 +6962,17 @@ zpool_do_online(int argc, char **argv)
(void) printf(gettext("use 'zpool "
"replace' to replace devices "
"that are no longer present\n"));
if ((flags & ZFS_ONLINE_EXPAND)) {
(void) printf(gettext("%s: failed "
"to expand usable space on "
"unhealthy device '%s'\n"),
(oldstate >= VDEV_STATE_DEGRADED ?
"error" : "warning"), argv[i]);
if (oldstate >= VDEV_STATE_DEGRADED) {
ret = 1;
break;
}
}
}
} else {
ret = 1;
Expand Down Expand Up @@ -7554,30 +7588,31 @@ print_scan_scrub_resilver_status(pool_scan_stat_t *ps)

zfs_nicebytes(ps->pss_processed, processed_buf, sizeof (processed_buf));

assert(ps->pss_func == POOL_SCAN_SCRUB ||
ps->pss_func == POOL_SCAN_RESILVER);
int is_resilver = ps->pss_func == POOL_SCAN_RESILVER;
int is_scrub = ps->pss_func == POOL_SCAN_SCRUB;
assert(is_resilver || is_scrub);

/* Scan is finished or canceled. */
if (ps->pss_state == DSS_FINISHED) {
secs_to_dhms(end - start, time_buf);

if (ps->pss_func == POOL_SCAN_SCRUB) {
if (is_scrub) {
(void) printf(gettext("scrub repaired %s "
"in %s with %llu errors on %s"), processed_buf,
time_buf, (u_longlong_t)ps->pss_errors,
ctime(&end));
} else if (ps->pss_func == POOL_SCAN_RESILVER) {
} else if (is_resilver) {
(void) printf(gettext("resilvered %s "
"in %s with %llu errors on %s"), processed_buf,
time_buf, (u_longlong_t)ps->pss_errors,
ctime(&end));
}
return;
} else if (ps->pss_state == DSS_CANCELED) {
if (ps->pss_func == POOL_SCAN_SCRUB) {
if (is_scrub) {
(void) printf(gettext("scrub canceled on %s"),
ctime(&end));
} else if (ps->pss_func == POOL_SCAN_RESILVER) {
} else if (is_resilver) {
(void) printf(gettext("resilver canceled on %s"),
ctime(&end));
}
Expand All @@ -7587,7 +7622,7 @@ print_scan_scrub_resilver_status(pool_scan_stat_t *ps)
assert(ps->pss_state == DSS_SCANNING);

/* Scan is in progress. Resilvers can't be paused. */
if (ps->pss_func == POOL_SCAN_SCRUB) {
if (is_scrub) {
if (pause == 0) {
(void) printf(gettext("scrub in progress since %s"),
ctime(&start));
Expand All @@ -7597,7 +7632,7 @@ print_scan_scrub_resilver_status(pool_scan_stat_t *ps)
(void) printf(gettext("\tscrub started on %s"),
ctime(&start));
}
} else if (ps->pss_func == POOL_SCAN_RESILVER) {
} else if (is_resilver) {
(void) printf(gettext("resilver in progress since %s"),
ctime(&start));
}
Expand Down Expand Up @@ -7639,17 +7674,27 @@ print_scan_scrub_resilver_status(pool_scan_stat_t *ps)
scanned_buf, issued_buf, total_buf);
}

if (ps->pss_func == POOL_SCAN_RESILVER) {
if (is_resilver) {
(void) printf(gettext("\t%s resilvered, %.2f%% done"),
processed_buf, 100 * fraction_done);
} else if (ps->pss_func == POOL_SCAN_SCRUB) {
} else if (is_scrub) {
(void) printf(gettext("\t%s repaired, %.2f%% done"),
processed_buf, 100 * fraction_done);
}

if (pause == 0) {
/*
* Only provide an estimate iff:
* 1) the time remaining is valid, and
* 2) the issue rate exceeds 10 MB/s, and
* 3) it's either:
* a) a resilver which has started repairs, or
* b) a scrub which has entered the issue phase.
*/
if (total_secs_left != UINT64_MAX &&
issue_rate >= 10 * 1024 * 1024) {
issue_rate >= 10 * 1024 * 1024 &&
((is_resilver && ps->pss_processed > 0) ||
(is_scrub && issued > 0))) {
(void) printf(gettext(", %s to go\n"), time_buf);
} else {
(void) printf(gettext(", no estimated "
Expand Down
31 changes: 31 additions & 0 deletions config/always-compiler-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,34 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA], [
CFLAGS="$saved_flags"
AC_SUBST([NO_IPA_SRA])
])

dnl #
dnl # Check if kernel cc supports -fno-ipa-sra option.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
AC_MSG_CHECKING([whether $KERNEL_CC supports -fno-ipa-sra])

saved_cc="$CC"
saved_flags="$CFLAGS"
CC="gcc"
CFLAGS="$CFLAGS -Werror -fno-ipa-sra"

AS_IF([ test -n "$KERNEL_CC" ], [
CC="$KERNEL_CC"
])
AS_IF([ test -n "$KERNEL_LLVM" ], [
CC="clang"
])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
KERNEL_NO_IPA_SRA=-fno-ipa-sra
AC_MSG_RESULT([yes])
], [
KERNEL_NO_IPA_SRA=
AC_MSG_RESULT([no])
])

CC="$saved_cc"
CFLAGS="$saved_flags"
AC_SUBST([KERNEL_NO_IPA_SRA])
])
34 changes: 28 additions & 6 deletions config/kernel-acl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,22 @@ dnl #
dnl # 6.2 API change,
dnl # set_acl() second paramter changed to a struct dentry *
dnl #
dnl # 6.3 API change,
dnl # set_acl() first parameter changed to struct mnt_idmap *
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [
#include <linux/fs.h>

int set_acl_fn(struct mnt_idmap *idmap,
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_dentry], [
#include <linux/fs.h>

Expand Down Expand Up @@ -281,17 +296,24 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
],[
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
AC_MSG_RESULT(yes)
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_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
[iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
],[
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
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 *])
],[
ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14])
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])
])
])
])
])
Expand Down
29 changes: 29 additions & 0 deletions config/kernel-cpu_has_feature.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dnl #
dnl # cpu_has_feature() may referencing GPL-only cpu_feature_keys on powerpc
dnl #

dnl #
dnl # Checking if cpu_has_feature is exported GPL-only
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE], [
ZFS_LINUX_TEST_SRC([cpu_has_feature], [
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
#include <asm/cpu_has_feature.h>
#else
#include <asm/cputable.h>
#endif
], [
return cpu_has_feature(CPU_FTR_ALTIVEC) ? 0 : 1;
], [], [ZFS_META_LICENSE])
])
AC_DEFUN([ZFS_AC_KERNEL_CPU_HAS_FEATURE], [
AC_MSG_CHECKING([whether cpu_has_feature() is GPL-only])
ZFS_LINUX_TEST_RESULT([cpu_has_feature_license], [
AC_MSG_RESULT(no)
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CPU_HAS_FEATURE_GPL_ONLY, 1,
[cpu_has_feature() is GPL-only])
])
])
26 changes: 26 additions & 0 deletions config/kernel-filemap.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dnl #
dnl # filemap_range_has_page was not available till 4.13
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILEMAP], [
ZFS_LINUX_TEST_SRC([filemap_range_has_page], [
#include <linux/fs.h>
],[
struct address_space *mapping = NULL;
loff_t lstart = 0;
loff_t lend = 0;
bool ret __attribute__ ((unused));

ret = filemap_range_has_page(mapping, lstart, lend);
])
])

AC_DEFUN([ZFS_AC_KERNEL_FILEMAP], [
AC_MSG_CHECKING([whether filemap_range_has_page() is available])
ZFS_LINUX_TEST_RESULT([filemap_range_has_page], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FILEMAP_RANGE_HAS_PAGE, 1,
[filemap_range_has_page() is available])
],[
AC_MSG_RESULT(no)
])
])
Loading