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

[stable/cobia] Sync with Upstream zfs-2.2-release #170

Merged
merged 39 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6c2fc56
Linux 6.5 compat: register_sysctl_table removed
ckane Aug 1, 2023
c0f075c
Linux 6.5 compat: use disk_check_media_change when it exists
ckane Aug 1, 2023
d76de9f
Linux 6.5 compat: blkdev changes
ckane Aug 1, 2023
0bf2c53
Linux 6.4 compat: iter_iov() function now used to get old iov member
ckane Jul 23, 2023
8be6308
Linux 4.20 compat: wrapper function for iov_iter type access
ckane Jul 30, 2023
3a68f3c
Revert "Linux 6.5 compat: register_sysctl_table removed"
bwatkinson Aug 1, 2023
31a4673
Linux 6.5 compat: register_sysctl_table removed
ckane Aug 2, 2023
5a22de1
Linux 6.5 compat: replace generic_file_splice_read with filemap_splic…
ckane Aug 7, 2023
58a7073
Linux 6.5 compat: Use copy_splice_read instead of filemap_splice_read
ckane Aug 8, 2023
c7ee59a
Linux 6.5 compat: safe cleanup in spl_proc_fini()
Sep 2, 2023
cacc599
Linux 6.5 compat: spl: properly unregister sysctl entries
Sep 7, 2023
c011ef8
Linux 6.5 compat: META (#15265)
tonyhutter Sep 12, 2023
1194365
Update the MOS directory on spa_upgrade_errlog()
gamanakis Sep 19, 2023
b9b9cdc
update max_variance limit in zdb_block_size_histogram test for CI
ednadolski-ix Sep 9, 2023
228b064
Remove implication that child `disk`s aren't vdevs in zpoolconcepts(7)
quartsize Sep 11, 2023
0ce7a06
check-zstd-symbols: also ignore __pfx_ symbols
nabijaczleweli Sep 18, 2023
54c6fbd
zed: Allow autoreplace and fault LEDs for removed vdevs
tonyhutter Sep 18, 2023
f7a07d7
Retire z_nr_znodes
mjguzik Sep 18, 2023
4723357
Do not enable zfs-share.service
usaleem-ix Aug 24, 2023
86c1cb8
Update the behavior of mountpoint property
usaleem-ix Sep 5, 2023
22da5ae
Improve the handling of sharesmb,sharenfs properties
usaleem-ix Sep 5, 2023
6267757
ZIL: Fix potential race on flush deferring.
amotin Sep 20, 2023
1c2aee7
tests: install missing PAM tests
robn Sep 19, 2023
cc75c81
Fix l2arc_apply_transforms ztest crash
pcd1193182 Sep 19, 2023
9aa1a28
Fix incorrect expected error in ztest
pcd1193182 Sep 19, 2023
3af6368
cmd: add 'help' subcommand to zpool and zfs
robn Sep 19, 2023
729507d
Fix occasional rsend test crashes
pcd1193182 Sep 20, 2023
a199cac
status: report pool suspension state under failmode=continue
robn Sep 20, 2023
5f30698
tests/block_cloning: try harder to stay on same txg in fallback test
robn Sep 22, 2023
0aabd6b
ZIL: Avoid dbuf_read() in ztest_get_data()
amotin Sep 22, 2023
0ce1b2c
Invoke zdb by guid to avoid import errors
pcd1193182 Sep 22, 2023
8526b12
Set timeout before creating pool in test
pcd1193182 Sep 25, 2023
ba4dbbd
ZTS: Add additional exceptions
behlendorf Sep 25, 2023
99dc1fc
ZTS: Fix introduced test bug in block_cloning_copyfilerange
pcd1193182 Sep 26, 2023
d38f466
Reduce trim min size even lower for tests to reduce flakiness
pcd1193182 Sep 27, 2023
9e36c57
Don't allocate from new metaslabs
pcd1193182 Sep 28, 2023
229ca7d
Fix ENOSPC for extended quota
akashb-22 Sep 28, 2023
fe88aff
Merge upstream zfs-2.2-release into truenas/zfs-2.2-release
ixhamza Oct 2, 2023
8e57472
Merge pull request #169 from truenas/zfs-2.2-release-sync-cobia-release
ixhamza Oct 2, 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
2 changes: 1 addition & 1 deletion META
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Release: rc4
Release-Tags: relext
License: CDDL
Author: OpenZFS
Linux-Maximum: 6.4
Linux-Maximum: 6.5
Linux-Minimum: 3.10
1 change: 1 addition & 0 deletions cmd/zed/agents/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
/* Only autoreplace bad disks */
if ((vs->vs_state != VDEV_STATE_DEGRADED) &&
(vs->vs_state != VDEV_STATE_FAULTED) &&
(vs->vs_state != VDEV_STATE_REMOVED) &&
(vs->vs_state != VDEV_STATE_CANT_OPEN)) {
zed_log_msg(LOG_INFO, " not autoreplacing since disk isn't in "
"a bad state (currently %llu)", vs->vs_state);
Expand Down
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/statechange-led.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ state_to_val()
{
state="$1"
case "$state" in
FAULTED|DEGRADED|UNAVAIL)
FAULTED|DEGRADED|UNAVAIL|REMOVED)
echo 1
;;
ONLINE)
Expand Down
36 changes: 33 additions & 3 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ static int zfs_do_zone(int argc, char **argv);
static int zfs_do_unzone(int argc, char **argv);
#endif

static int zfs_do_help(int argc, char **argv);

/*
* Enable a reasonable set of defaults for libumem debugging on DEBUG builds.
*/
Expand Down Expand Up @@ -606,6 +608,9 @@ usage(boolean_t requested)
(void) fprintf(fp,
gettext("\nFor the delegated permission list, run: %s\n"),
"zfs allow|unallow");
(void) fprintf(fp,
gettext("\nFor further help on a command or topic, "
"run: %s\n"), "zfs help [<topic>]");
}

/*
Expand Down Expand Up @@ -4198,8 +4203,9 @@ static int
set_callback(zfs_handle_t *zhp, void *data)
{
nvlist_t *props = data;
int ret = zfs_prop_set_list(zhp, props);

if (zfs_prop_set_list(zhp, props) != 0) {
if (ret != 0 || libzfs_errno(g_zfs) != EZFS_SUCCESS) {
switch (libzfs_errno(g_zfs)) {
case EZFS_MOUNTFAILED:
(void) fprintf(stderr, gettext("property may be set "
Expand All @@ -4210,9 +4216,8 @@ set_callback(zfs_handle_t *zhp, void *data)
"but unable to reshare filesystem\n"));
break;
}
return (1);
}
return (0);
return (ret);
}

static int
Expand Down Expand Up @@ -8726,6 +8731,25 @@ zfs_do_version(int argc, char **argv)
return (zfs_version_print() != 0);
}

/* Display documentation */
static int
zfs_do_help(int argc, char **argv)
{
char page[MAXNAMELEN];
if (argc < 3 || strcmp(argv[2], "zfs") == 0)
strcpy(page, "zfs");
else if (strcmp(argv[2], "concepts") == 0 ||
strcmp(argv[2], "props") == 0)
snprintf(page, sizeof (page), "zfs%s", argv[2]);
else
snprintf(page, sizeof (page), "zfs-%s", argv[2]);

execlp("man", "man", page, NULL);

fprintf(stderr, "couldn't run man program: %s", strerror(errno));
return (-1);
}

int
main(int argc, char **argv)
{
Expand Down Expand Up @@ -8781,6 +8805,12 @@ main(int argc, char **argv)
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
return (zfs_do_version(argc, argv));

/*
* Special case 'help'
*/
if (strcmp(cmdname, "help") == 0)
return (zfs_do_help(argc, argv));

if ((g_zfs = libzfs_init()) == NULL) {
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
return (1);
Expand Down
31 changes: 31 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ static int zpool_do_version(int, char **);

static int zpool_do_wait(int, char **);

static int zpool_do_help(int argc, char **argv);

static zpool_compat_status_t zpool_do_load_compat(
const char *, boolean_t *);

Expand Down Expand Up @@ -538,6 +540,10 @@ usage(boolean_t requested)
(void) fprintf(fp, "%s",
get_usage(command_table[i].usage));
}

(void) fprintf(fp,
gettext("\nFor further help on a command or topic, "
"run: %s\n"), "zpool help [<topic>]");
} else {
(void) fprintf(fp, gettext("usage:\n"));
(void) fprintf(fp, "%s", get_usage(current_command->usage));
Expand Down Expand Up @@ -11051,6 +11057,25 @@ zpool_do_version(int argc, char **argv)
return (zfs_version_print() != 0);
}

/* Display documentation */
static int
zpool_do_help(int argc, char **argv)
{
char page[MAXNAMELEN];
if (argc < 3 || strcmp(argv[2], "zpool") == 0)
strcpy(page, "zpool");
else if (strcmp(argv[2], "concepts") == 0 ||
strcmp(argv[2], "props") == 0)
snprintf(page, sizeof (page), "zpool%s", argv[2]);
else
snprintf(page, sizeof (page), "zpool-%s", argv[2]);

execlp("man", "man", page, NULL);

fprintf(stderr, "couldn't run man program: %s", strerror(errno));
return (-1);
}

/*
* Do zpool_load_compat() and print error message on failure
*/
Expand Down Expand Up @@ -11118,6 +11143,12 @@ main(int argc, char **argv)
if ((strcmp(cmdname, "-V") == 0) || (strcmp(cmdname, "--version") == 0))
return (zpool_do_version(argc, argv));

/*
* Special case 'help'
*/
if (strcmp(cmdname, "help") == 0)
return (zpool_do_help(argc, argv));

if ((g_zfs = libzfs_init()) == NULL) {
(void) fprintf(stderr, "%s\n", libzfs_error_init(errno));
return (1);
Expand Down
26 changes: 14 additions & 12 deletions cmd/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2457,8 +2457,7 @@ ztest_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
zgd->zgd_lr = (struct zfs_locked_range *)ztest_range_lock(zd,
object, offset, size, RL_READER);

error = dmu_buf_hold(os, object, offset, zgd, &db,
DMU_READ_NO_PREFETCH);
error = dmu_buf_hold_noread(os, object, offset, zgd, &db);

if (error == 0) {
blkptr_t *bp = &lr->lr_blkptr;
Expand Down Expand Up @@ -3767,7 +3766,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
else if (ashift > oldvd->vdev_top->vdev_ashift)
expected_error = EDOM;
else if (newvd_is_dspare && pvd != vdev_draid_spare_get_parent(newvd))
expected_error = ENOTSUP;
expected_error = EINVAL;
else
expected_error = 0;

Expand Down Expand Up @@ -6379,6 +6378,7 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id)
spa_t *spa = ztest_spa;
uint64_t orig, load;
int error;
ztest_shared_t *zs = ztest_shared;

if (ztest_opts.zo_mmp_test)
return;
Expand All @@ -6388,6 +6388,7 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id)

(void) pthread_rwlock_wrlock(&ztest_name_lock);
error = spa_change_guid(spa);
zs->zs_guid = spa_guid(spa);
(void) pthread_rwlock_unlock(&ztest_name_lock);

if (error != 0)
Expand Down Expand Up @@ -6917,7 +6918,7 @@ ztest_trim(ztest_ds_t *zd, uint64_t id)
* Verify pool integrity by running zdb.
*/
static void
ztest_run_zdb(const char *pool)
ztest_run_zdb(uint64_t guid)
{
int status;
char *bin;
Expand All @@ -6941,13 +6942,13 @@ ztest_run_zdb(const char *pool)
free(set_gvars_args);

size_t would = snprintf(zdb, len,
"%s -bcc%s%s -G -d -Y -e -y %s -p %s %s",
"%s -bcc%s%s -G -d -Y -e -y %s -p %s %"PRIu64,
bin,
ztest_opts.zo_verbose >= 3 ? "s" : "",
ztest_opts.zo_verbose >= 4 ? "v" : "",
set_gvars_args_joined,
ztest_opts.zo_dir,
pool);
guid);
ASSERT3U(would, <, len);

umem_free(set_gvars_args_joined, strlen(set_gvars_args_joined) + 1);
Expand Down Expand Up @@ -7525,14 +7526,15 @@ ztest_import(ztest_shared_t *zs)
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
zs->zs_metaslab_sz =
1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
zs->zs_guid = spa_guid(spa);
spa_close(spa, FTAG);

kernel_fini();

if (!ztest_opts.zo_mmp_test) {
ztest_run_zdb(ztest_opts.zo_pool);
ztest_run_zdb(zs->zs_guid);
ztest_freeze();
ztest_run_zdb(ztest_opts.zo_pool);
ztest_run_zdb(zs->zs_guid);
}

(void) pthread_rwlock_destroy(&ztest_name_lock);
Expand Down Expand Up @@ -7603,7 +7605,6 @@ ztest_run(ztest_shared_t *zs)
dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
dmu_objset_fast_stat(os, &dds);
dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
zs->zs_guid = dds.dds_guid;
dmu_objset_disown(os, B_TRUE, FTAG);

/*
Expand Down Expand Up @@ -7874,14 +7875,15 @@ ztest_init(ztest_shared_t *zs)
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
zs->zs_metaslab_sz =
1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
zs->zs_guid = spa_guid(spa);
spa_close(spa, FTAG);

kernel_fini();

if (!ztest_opts.zo_mmp_test) {
ztest_run_zdb(ztest_opts.zo_pool);
ztest_run_zdb(zs->zs_guid);
ztest_freeze();
ztest_run_zdb(ztest_opts.zo_pool);
ztest_run_zdb(zs->zs_guid);
}

(void) pthread_rwlock_destroy(&ztest_name_lock);
Expand Down Expand Up @@ -8304,7 +8306,7 @@ main(int argc, char **argv)
}

if (!ztest_opts.zo_mmp_test)
ztest_run_zdb(ztest_opts.zo_pool);
ztest_run_zdb(zs->zs_guid);
}

if (ztest_opts.zo_verbose >= 1) {
Expand Down
Loading