zfs: merge openzfs/zfs@f3678d70f (master) into main

Notable upstream pull request merges:
  #12339 Read past end of argv array in zpool_do_import()
  #12365 Fixes in persistent L2ARC
  #12383 Fixes for KMSAN reports
  #12425 Avoid small buffer copying on write
  #12428 Fix unfortunate NULL in spa_update_dspace
  #12446 Allow disabling of unmapped I/O on FreeBSD

Obtained from:	OpenZFS
OpenZFS commit:	f3678d70ff8f98d67caf377ec0326c9a6c7bcf29
This commit is contained in:
Martin Matuska 2021-08-08 03:57:07 +02:00
commit 1f88aa0941
114 changed files with 12497 additions and 16834 deletions

View File

@ -368,8 +368,8 @@ main(int argc, char **argv)
"mount the filesystem again.\n"), dataset); "mount the filesystem again.\n"), dataset);
return (MOUNT_SYSERR); return (MOUNT_SYSERR);
} }
/* fallthru */
#endif #endif
/* FALLTHROUGH */
default: default:
(void) fprintf(stderr, gettext("filesystem " (void) fprintf(stderr, gettext("filesystem "
"'%s' can not be mounted: %s\n"), dataset, "'%s' can not be mounted: %s\n"), dataset,

View File

@ -414,10 +414,9 @@ get_usage(zfs_help_t idx)
return (gettext("\tunjail <jailid|jailname> <filesystem>\n")); return (gettext("\tunjail <jailid|jailname> <filesystem>\n"));
case HELP_WAIT: case HELP_WAIT:
return (gettext("\twait [-t <activity>] <filesystem>\n")); return (gettext("\twait [-t <activity>] <filesystem>\n"));
default:
__builtin_unreachable();
} }
abort();
/* NOTREACHED */
} }
void void
@ -4511,7 +4510,6 @@ zfs_do_send(int argc, char **argv)
usage(B_FALSE); usage(B_FALSE);
break; break;
case '?': case '?':
/*FALLTHROUGH*/
default: default:
/* /*
* If an invalid flag was passed, optopt contains the * If an invalid flag was passed, optopt contains the

View File

@ -36,7 +36,7 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
static void static __attribute__((noreturn)) void
usage(void) usage(void)
{ {
(void) fprintf(stderr, (void) fprintf(stderr,
@ -51,7 +51,6 @@ usage(void)
" will be generated.\n" " will be generated.\n"
"The value must be unique among your systems.\n"); "The value must be unique among your systems.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
/* NOTREACHED */
} }
int int

View File

@ -56,7 +56,7 @@ static importargs_t g_importargs;
static char *g_pool; static char *g_pool;
static boolean_t g_readonly; static boolean_t g_readonly;
static void static __attribute__((noreturn)) void
usage(void) usage(void)
{ {
(void) fprintf(stderr, (void) fprintf(stderr,
@ -81,7 +81,7 @@ usage(void)
} }
static void static __attribute__((noreturn)) __attribute__((format(printf, 3, 4))) void
fatal(spa_t *spa, void *tag, const char *fmt, ...) fatal(spa_t *spa, void *tag, const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -112,7 +112,6 @@ space_delta_cb(dmu_object_type_t bonustype, const void *data,
return (ENOENT); return (ENOENT);
(void) fprintf(stderr, "modifying object that needs user accounting"); (void) fprintf(stderr, "modifying object that needs user accounting");
abort(); abort();
/* NOTREACHED */
} }
/* /*
@ -318,7 +317,8 @@ zhack_do_feature_enable(int argc, char **argv)
mos = spa->spa_meta_objset; mos = spa->spa_meta_objset;
if (zfeature_is_supported(feature.fi_guid)) if (zfeature_is_supported(feature.fi_guid))
fatal(spa, FTAG, "'%s' is a real feature, will not enable"); fatal(spa, FTAG, "'%s' is a real feature, will not enable",
feature.fi_guid);
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
fatal(spa, FTAG, "feature already enabled: %s", fatal(spa, FTAG, "feature already enabled: %s",
feature.fi_guid); feature.fi_guid);
@ -412,7 +412,8 @@ zhack_do_feature_ref(int argc, char **argv)
if (zfeature_is_supported(feature.fi_guid)) { if (zfeature_is_supported(feature.fi_guid)) {
fatal(spa, FTAG, fatal(spa, FTAG,
"'%s' is a real feature, will not change refcount"); "'%s' is a real feature, will not change refcount",
feature.fi_guid);
} }
if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,

View File

@ -116,3 +116,9 @@ after_zpool_upgrade(zpool_handle_t *zhp)
"details.\n"), zpool_get_name(zhp)); "details.\n"), zpool_get_name(zhp));
} }
} }
int
check_file(const char *file, boolean_t force, boolean_t isspare)
{
return (check_file_generic(file, force, isspare));
}

View File

@ -410,3 +410,9 @@ void
after_zpool_upgrade(zpool_handle_t *zhp) after_zpool_upgrade(zpool_handle_t *zhp)
{ {
} }
int
check_file(const char *file, boolean_t force, boolean_t isspare)
{
return (check_file_generic(file, force, isspare));
}

View File

@ -429,10 +429,9 @@ get_usage(zpool_help_t idx)
case HELP_WAIT: case HELP_WAIT:
return (gettext("\twait [-Hp] [-T d|u] [-t <activity>[,...]] " return (gettext("\twait [-Hp] [-T d|u] [-t <activity>[,...]] "
"<pool> [interval]\n")); "<pool> [interval]\n"));
default:
__builtin_unreachable();
} }
abort();
/* NOTREACHED */
} }
static void static void
@ -3746,9 +3745,10 @@ zpool_do_import(int argc, char **argv)
return (1); return (1);
} }
err = import_pools(pools, props, mntopts, flags, argv[0], err = import_pools(pools, props, mntopts, flags,
argc == 1 ? NULL : argv[1], do_destroyed, pool_specified, argc >= 1 ? argv[0] : NULL,
do_all, &idata); argc >= 2 ? argv[1] : NULL,
do_destroyed, pool_specified, do_all, &idata);
/* /*
* If we're using the cachefile and we failed to import, then * If we're using the cachefile and we failed to import, then
@ -3768,9 +3768,10 @@ zpool_do_import(int argc, char **argv)
nvlist_free(pools); nvlist_free(pools);
pools = zpool_search_import(g_zfs, &idata, &libzfs_config_ops); pools = zpool_search_import(g_zfs, &idata, &libzfs_config_ops);
err = import_pools(pools, props, mntopts, flags, argv[0], err = import_pools(pools, props, mntopts, flags,
argc == 1 ? NULL : argv[1], do_destroyed, pool_specified, argc >= 1 ? argv[0] : NULL,
do_all, &idata); argc >= 2 ? argv[1] : NULL,
do_destroyed, pool_specified, do_all, &idata);
} }
error: error:

View File

@ -128,9 +128,10 @@ void free_vdev_cmd_data_list(vdev_cmd_data_list_t *vcdl);
int check_device(const char *path, boolean_t force, int check_device(const char *path, boolean_t force,
boolean_t isspare, boolean_t iswholedisk); boolean_t isspare, boolean_t iswholedisk);
boolean_t check_sector_size_database(char *path, int *sector_size); boolean_t check_sector_size_database(char *path, int *sector_size);
void vdev_error(const char *fmt, ...); void vdev_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
int check_file(const char *file, boolean_t force, boolean_t isspare); int check_file(const char *file, boolean_t force, boolean_t isspare);
void after_zpool_upgrade(zpool_handle_t *zhp); void after_zpool_upgrade(zpool_handle_t *zhp);
int check_file_generic(const char *file, boolean_t force, boolean_t isspare);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -86,7 +86,6 @@
boolean_t error_seen; boolean_t error_seen;
boolean_t is_force; boolean_t is_force;
/*PRINTFLIKE1*/
void void
vdev_error(const char *fmt, ...) vdev_error(const char *fmt, ...)
{ {
@ -113,7 +112,7 @@ vdev_error(const char *fmt, ...)
* not in use by another pool, and not in use by swap. * not in use by another pool, and not in use by swap.
*/ */
int int
check_file(const char *file, boolean_t force, boolean_t isspare) check_file_generic(const char *file, boolean_t force, boolean_t isspare)
{ {
char *name; char *name;
int fd; int fd;
@ -704,8 +703,11 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
"are present\n"), "are present\n"),
raidz->zprl_type, raidz->zprl_type,
mirror->zprl_type, mirror->zprl_type,
(u_longlong_t)
raidz->zprl_parity, raidz->zprl_parity,
(u_longlong_t)
mirror->zprl_children - 1, mirror->zprl_children - 1,
(u_longlong_t)
mirror->zprl_children); mirror->zprl_children);
else else
return (NULL); return (NULL);
@ -728,7 +730,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
"%llu are present\n"), "%llu are present\n"),
lastrep.zprl_type, lastrep.zprl_type,
rep.zprl_type, rep.zprl_type,
(u_longlong_t)
lastrep.zprl_parity, lastrep.zprl_parity,
(u_longlong_t)
rep.zprl_parity); rep.zprl_parity);
else else
return (NULL); return (NULL);
@ -755,8 +759,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
"mismatched replication level: " "mismatched replication level: "
"both %llu and %llu device parity " "both %llu and %llu device parity "
"%s vdevs are present\n"), "%s vdevs are present\n"),
(u_longlong_t)
lastrep.zprl_parity, lastrep.zprl_parity,
rep.zprl_parity, (u_longlong_t)rep.zprl_parity,
rep.zprl_type); rep.zprl_type);
else else
return (NULL); return (NULL);
@ -769,7 +774,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
"mismatched replication level: " "mismatched replication level: "
"both %llu-way and %llu-way %s " "both %llu-way and %llu-way %s "
"vdevs are present\n"), "vdevs are present\n"),
(u_longlong_t)
lastrep.zprl_children, lastrep.zprl_children,
(u_longlong_t)
rep.zprl_children, rep.zprl_children,
rep.zprl_type); rep.zprl_type);
else else
@ -854,9 +861,9 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
"and %s vdevs, %llu vs. %llu (%llu-way)\n"), "and %s vdevs, %llu vs. %llu (%llu-way)\n"),
raidz->zprl_type, raidz->zprl_type,
mirror->zprl_type, mirror->zprl_type,
raidz->zprl_parity, (u_longlong_t)raidz->zprl_parity,
mirror->zprl_children - 1, (u_longlong_t)mirror->zprl_children - 1,
mirror->zprl_children); (u_longlong_t)mirror->zprl_children);
ret = -1; ret = -1;
} }
} else if (strcmp(current->zprl_type, new->zprl_type) != 0) { } else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
@ -869,14 +876,17 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
vdev_error(gettext( vdev_error(gettext(
"mismatched replication level: pool uses %llu " "mismatched replication level: pool uses %llu "
"device parity and new vdev uses %llu\n"), "device parity and new vdev uses %llu\n"),
current->zprl_parity, new->zprl_parity); (u_longlong_t)current->zprl_parity,
(u_longlong_t)new->zprl_parity);
ret = -1; ret = -1;
} else if (current->zprl_children != new->zprl_children) { } else if (current->zprl_children != new->zprl_children) {
vdev_error(gettext( vdev_error(gettext(
"mismatched replication level: pool uses %llu-way " "mismatched replication level: pool uses %llu-way "
"%s and new vdev uses %llu-way %s\n"), "%s and new vdev uses %llu-way %s\n"),
current->zprl_children, current->zprl_type, (u_longlong_t)current->zprl_children,
new->zprl_children, new->zprl_type); current->zprl_type,
(u_longlong_t)new->zprl_children,
new->zprl_type);
ret = -1; ret = -1;
} }
} }

View File

@ -118,6 +118,7 @@ escape_string(const char *s)
case '=': case '=':
case '\\': case '\\':
*d++ = '\\'; *d++ = '\\';
/* FALLTHROUGH */
default: default:
*d = *c; *d = *c;
} }

View File

@ -622,7 +622,7 @@ static void sig_handler(int signo)
char *fatal_msg; char *fatal_msg;
static void static __attribute__((noreturn)) __attribute__((format(printf, 2, 3))) void
fatal(int do_perror, char *message, ...) fatal(int do_perror, char *message, ...)
{ {
va_list args; va_list args;
@ -674,7 +674,6 @@ str2shift(const char *buf)
} }
(void) fprintf(stderr, "ztest: invalid bytes suffix: %s\n", buf); (void) fprintf(stderr, "ztest: invalid bytes suffix: %s\n", buf);
usage(B_FALSE); usage(B_FALSE);
/* NOTREACHED */
} }
static uint64_t static uint64_t
@ -875,7 +874,7 @@ ztest_random(uint64_t range)
return (0); return (0);
if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r)) if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r))
fatal(1, "short read from /dev/urandom"); fatal(B_TRUE, "short read from /dev/urandom");
return (r % range); return (r % range);
} }
@ -1210,9 +1209,8 @@ ztest_is_draid_spare(const char *name)
{ {
uint64_t spare_id = 0, parity = 0, vdev_id = 0; uint64_t spare_id = 0, parity = 0, vdev_id = 0;
if (sscanf(name, VDEV_TYPE_DRAID "%llu-%llu-%llu", if (sscanf(name, VDEV_TYPE_DRAID "%"PRIu64"-%"PRIu64"-%"PRIu64"",
(u_longlong_t *)&parity, (u_longlong_t *)&vdev_id, &parity, &vdev_id, &spare_id) == 3) {
(u_longlong_t *)&spare_id) == 3) {
return (B_TRUE); return (B_TRUE);
} }
@ -1254,9 +1252,9 @@ make_vdev_file(char *path, char *aux, char *pool, size_t size, uint64_t ashift)
if (size != 0 && !draid_spare) { if (size != 0 && !draid_spare) {
int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0666); int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0666);
if (fd == -1) if (fd == -1)
fatal(1, "can't open %s", path); fatal(B_TRUE, "can't open %s", path);
if (ftruncate(fd, size) != 0) if (ftruncate(fd, size) != 0)
fatal(1, "can't ftruncate %s", path); fatal(B_TRUE, "can't ftruncate %s", path);
(void) close(fd); (void) close(fd);
} }
@ -2841,8 +2839,9 @@ ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index,
od->od_blocksize = 0; od->od_blocksize = 0;
od->od_gen = 0; od->od_gen = 0;
(void) snprintf(od->od_name, sizeof (od->od_name), "%s(%lld)[%llu]", (void) snprintf(od->od_name, sizeof (od->od_name),
tag, (longlong_t)id, (u_longlong_t)index); "%s(%"PRId64")[%"PRIu64"]",
tag, id, index);
} }
/* /*
@ -2985,7 +2984,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
VERIFY0(spa_open(zo->zo_pool, &spa, FTAG)); VERIFY0(spa_open(zo->zo_pool, &spa, FTAG));
int error = spa_destroy(zo->zo_pool); int error = spa_destroy(zo->zo_pool);
if (error != EBUSY && error != ZFS_ERR_EXPORT_IN_PROGRESS) { if (error != EBUSY && error != ZFS_ERR_EXPORT_IN_PROGRESS) {
fatal(0, "spa_destroy(%s) returned unexpected value %d", fatal(B_FALSE, "spa_destroy(%s) returned unexpected value %d",
spa->spa_name, error); spa->spa_name, error);
} }
spa_close(spa, FTAG); spa_close(spa, FTAG);
@ -3108,8 +3107,9 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id)
newversion = ztest_random_spa_version(version + 1); newversion = ztest_random_spa_version(version + 1);
if (ztest_opts.zo_verbose >= 4) { if (ztest_opts.zo_verbose >= 4) {
(void) printf("upgrading spa version from %llu to %llu\n", (void) printf("upgrading spa version from "
(u_longlong_t)version, (u_longlong_t)newversion); "%"PRIu64" to %"PRIu64"\n",
version, newversion);
} }
spa_upgrade(spa, newversion); spa_upgrade(spa, newversion);
@ -3139,7 +3139,7 @@ ztest_spa_checkpoint(spa_t *spa)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
break; break;
default: default:
fatal(0, "spa_checkpoint(%s) = %d", spa->spa_name, error); fatal(B_FALSE, "spa_checkpoint(%s) = %d", spa->spa_name, error);
} }
} }
@ -3156,7 +3156,7 @@ ztest_spa_discard_checkpoint(spa_t *spa)
case ZFS_ERR_NO_CHECKPOINT: case ZFS_ERR_NO_CHECKPOINT:
break; break;
default: default:
fatal(0, "spa_discard_checkpoint(%s) = %d", fatal(B_FALSE, "spa_discard_checkpoint(%s) = %d",
spa->spa_name, error); spa->spa_name, error);
} }
@ -3266,7 +3266,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
case ZFS_ERR_DISCARDING_CHECKPOINT: case ZFS_ERR_DISCARDING_CHECKPOINT:
break; break;
default: default:
fatal(0, "spa_vdev_remove() = %d", error); fatal(B_FALSE, "spa_vdev_remove() = %d", error);
} }
} else { } else {
spa_config_exit(spa, SCL_VDEV, FTAG); spa_config_exit(spa, SCL_VDEV, FTAG);
@ -3289,7 +3289,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc("spa_vdev_add"); ztest_record_enospc("spa_vdev_add");
break; break;
default: default:
fatal(0, "spa_vdev_add() = %d", error); fatal(B_FALSE, "spa_vdev_add() = %d", error);
} }
} }
@ -3347,7 +3347,7 @@ ztest_vdev_class_add(ztest_ds_t *zd, uint64_t id)
if (error == ENOSPC) if (error == ENOSPC)
ztest_record_enospc("spa_vdev_add"); ztest_record_enospc("spa_vdev_add");
else if (error != 0) else if (error != 0)
fatal(0, "spa_vdev_add() = %d", error); fatal(B_FALSE, "spa_vdev_add() = %d", error);
/* /*
* 50% of the time allow small blocks in the special class * 50% of the time allow small blocks in the special class
@ -3453,7 +3453,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
case 0: case 0:
break; break;
default: default:
fatal(0, "spa_vdev_add(%p) = %d", nvroot, error); fatal(B_FALSE, "spa_vdev_add(%p) = %d", nvroot, error);
} }
fnvlist_free(nvroot); fnvlist_free(nvroot);
} else { } else {
@ -3475,8 +3475,9 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
break; break;
default: default:
if (error != ignore_err) if (error != ignore_err)
fatal(0, "spa_vdev_remove(%llu) = %d", guid, fatal(B_FALSE,
error); "spa_vdev_remove(%"PRIu64") = %d",
guid, error);
} }
} }
@ -3698,7 +3699,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
if (error != 0 && error != ENODEV && error != EBUSY && if (error != 0 && error != ENODEV && error != EBUSY &&
error != ENOTSUP && error != ZFS_ERR_CHECKPOINT_EXISTS && error != ENOTSUP && error != ZFS_ERR_CHECKPOINT_EXISTS &&
error != ZFS_ERR_DISCARDING_CHECKPOINT) error != ZFS_ERR_DISCARDING_CHECKPOINT)
fatal(0, "detach (%s) returned %d", oldpath, error); fatal(B_FALSE, "detach (%s) returned %d",
oldpath, error);
goto out; goto out;
} }
@ -3813,7 +3815,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
expected_error = error; expected_error = error;
if (error != expected_error && expected_error != EBUSY) { if (error != expected_error && expected_error != EBUSY) {
fatal(0, "attach (%s %llu, %s %llu, %d) " fatal(B_FALSE, "attach (%s %"PRIu64", %s %"PRIu64", %d) "
"returned %d, expected %d", "returned %d, expected %d",
oldpath, oldsize, newpath, oldpath, oldsize, newpath,
newsize, replacing, error, expected_error); newsize, replacing, error, expected_error);
@ -3944,8 +3946,8 @@ online_vdev(vdev_t *vd, void *arg)
*/ */
if (error || newstate != VDEV_STATE_HEALTHY) { if (error || newstate != VDEV_STATE_HEALTHY) {
if (ztest_opts.zo_verbose >= 5) { if (ztest_opts.zo_verbose >= 5) {
(void) printf("Unable to expand vdev, state %llu, " (void) printf("Unable to expand vdev, state %u, "
"error %d\n", (u_longlong_t)newstate, error); "error %d\n", newstate, error);
} }
return (vd); return (vd);
} }
@ -3960,12 +3962,12 @@ online_vdev(vdev_t *vd, void *arg)
if (generation != spa->spa_config_generation) { if (generation != spa->spa_config_generation) {
if (ztest_opts.zo_verbose >= 5) { if (ztest_opts.zo_verbose >= 5) {
(void) printf("vdev configuration has changed, " (void) printf("vdev configuration has changed, "
"guid %llu, state %llu, expected gen %llu, " "guid %"PRIu64", state %"PRIu64", "
"got gen %llu\n", "expected gen %"PRIu64", got gen %"PRIu64"\n",
(u_longlong_t)guid, guid,
(u_longlong_t)tvd->vdev_state, tvd->vdev_state,
(u_longlong_t)generation, generation,
(u_longlong_t)spa->spa_config_generation); spa->spa_config_generation);
} }
return (vd); return (vd);
} }
@ -4126,7 +4128,8 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
* Make sure we were able to grow the vdev. * Make sure we were able to grow the vdev.
*/ */
if (new_ms_count <= old_ms_count) { if (new_ms_count <= old_ms_count) {
fatal(0, "LUN expansion failed: ms_count %llu < %llu\n", fatal(B_FALSE,
"LUN expansion failed: ms_count %"PRIu64" < %"PRIu64"\n",
old_ms_count, new_ms_count); old_ms_count, new_ms_count);
} }
@ -4134,7 +4137,8 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
* Make sure we were able to grow the pool. * Make sure we were able to grow the pool.
*/ */
if (new_class_space <= old_class_space) { if (new_class_space <= old_class_space) {
fatal(0, "LUN expansion failed: class_space %llu < %llu\n", fatal(B_FALSE,
"LUN expansion failed: class_space %"PRIu64" < %"PRIu64"\n",
old_class_space, new_class_space); old_class_space, new_class_space);
} }
@ -4281,7 +4285,7 @@ ztest_snapshot_create(char *osname, uint64_t id)
char snapname[ZFS_MAX_DATASET_NAME_LEN]; char snapname[ZFS_MAX_DATASET_NAME_LEN];
int error; int error;
(void) snprintf(snapname, sizeof (snapname), "%llu", (u_longlong_t)id); (void) snprintf(snapname, sizeof (snapname), "%"PRIu64"", id);
error = dmu_objset_snapshot_one(osname, snapname); error = dmu_objset_snapshot_one(osname, snapname);
if (error == ENOSPC) { if (error == ENOSPC) {
@ -4289,7 +4293,7 @@ ztest_snapshot_create(char *osname, uint64_t id)
return (B_FALSE); return (B_FALSE);
} }
if (error != 0 && error != EEXIST) { if (error != 0 && error != EEXIST) {
fatal(0, "ztest_snapshot_create(%s@%s) = %d", osname, fatal(B_FALSE, "ztest_snapshot_create(%s@%s) = %d", osname,
snapname, error); snapname, error);
} }
return (B_TRUE); return (B_TRUE);
@ -4301,12 +4305,13 @@ ztest_snapshot_destroy(char *osname, uint64_t id)
char snapname[ZFS_MAX_DATASET_NAME_LEN]; char snapname[ZFS_MAX_DATASET_NAME_LEN];
int error; int error;
(void) snprintf(snapname, sizeof (snapname), "%s@%llu", osname, (void) snprintf(snapname, sizeof (snapname), "%s@%"PRIu64"",
(u_longlong_t)id); osname, id);
error = dsl_destroy_snapshot(snapname, B_FALSE); error = dsl_destroy_snapshot(snapname, B_FALSE);
if (error != 0 && error != ENOENT) if (error != 0 && error != ENOENT)
fatal(0, "ztest_snapshot_destroy(%s) = %d", snapname, error); fatal(B_FALSE, "ztest_snapshot_destroy(%s) = %d",
snapname, error);
return (B_TRUE); return (B_TRUE);
} }
@ -4326,8 +4331,8 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
(void) pthread_rwlock_rdlock(&ztest_name_lock); (void) pthread_rwlock_rdlock(&ztest_name_lock);
(void) snprintf(name, sizeof (name), "%s/temp_%llu", (void) snprintf(name, sizeof (name), "%s/temp_%"PRIu64"",
ztest_opts.zo_pool, (u_longlong_t)id); ztest_opts.zo_pool, id);
/* /*
* If this dataset exists from a previous run, process its replay log * If this dataset exists from a previous run, process its replay log
@ -4366,7 +4371,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_objset_create(%s) = %d", name, error); fatal(B_FALSE, "dmu_objset_create(%s) = %d", name, error);
} }
VERIFY0(ztest_dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, B_TRUE, VERIFY0(ztest_dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, B_TRUE,
@ -4448,32 +4453,35 @@ ztest_dsl_dataset_cleanup(char *osname, uint64_t id)
clone2name = umem_alloc(ZFS_MAX_DATASET_NAME_LEN, UMEM_NOFAIL); clone2name = umem_alloc(ZFS_MAX_DATASET_NAME_LEN, UMEM_NOFAIL);
snap3name = umem_alloc(ZFS_MAX_DATASET_NAME_LEN, UMEM_NOFAIL); snap3name = umem_alloc(ZFS_MAX_DATASET_NAME_LEN, UMEM_NOFAIL);
(void) snprintf(snap1name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap1name, ZFS_MAX_DATASET_NAME_LEN, "%s@s1_%"PRIu64"",
"%s@s1_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(clone1name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(clone1name, ZFS_MAX_DATASET_NAME_LEN, "%s/c1_%"PRIu64"",
"%s/c1_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(snap2name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap2name, ZFS_MAX_DATASET_NAME_LEN, "%s@s2_%"PRIu64"",
"%s@s2_%llu", clone1name, (u_longlong_t)id); clone1name, id);
(void) snprintf(clone2name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(clone2name, ZFS_MAX_DATASET_NAME_LEN, "%s/c2_%"PRIu64"",
"%s/c2_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(snap3name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap3name, ZFS_MAX_DATASET_NAME_LEN, "%s@s3_%"PRIu64"",
"%s@s3_%llu", clone1name, (u_longlong_t)id); clone1name, id);
error = dsl_destroy_head(clone2name); error = dsl_destroy_head(clone2name);
if (error && error != ENOENT) if (error && error != ENOENT)
fatal(0, "dsl_destroy_head(%s) = %d", clone2name, error); fatal(B_FALSE, "dsl_destroy_head(%s) = %d", clone2name, error);
error = dsl_destroy_snapshot(snap3name, B_FALSE); error = dsl_destroy_snapshot(snap3name, B_FALSE);
if (error && error != ENOENT) if (error && error != ENOENT)
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap3name, error); fatal(B_FALSE, "dsl_destroy_snapshot(%s) = %d",
snap3name, error);
error = dsl_destroy_snapshot(snap2name, B_FALSE); error = dsl_destroy_snapshot(snap2name, B_FALSE);
if (error && error != ENOENT) if (error && error != ENOENT)
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap2name, error); fatal(B_FALSE, "dsl_destroy_snapshot(%s) = %d",
snap2name, error);
error = dsl_destroy_head(clone1name); error = dsl_destroy_head(clone1name);
if (error && error != ENOENT) if (error && error != ENOENT)
fatal(0, "dsl_destroy_head(%s) = %d", clone1name, error); fatal(B_FALSE, "dsl_destroy_head(%s) = %d", clone1name, error);
error = dsl_destroy_snapshot(snap1name, B_FALSE); error = dsl_destroy_snapshot(snap1name, B_FALSE);
if (error && error != ENOENT) if (error && error != ENOENT)
fatal(0, "dsl_destroy_snapshot(%s) = %d", snap1name, error); fatal(B_FALSE, "dsl_destroy_snapshot(%s) = %d",
snap1name, error);
umem_free(snap1name, ZFS_MAX_DATASET_NAME_LEN); umem_free(snap1name, ZFS_MAX_DATASET_NAME_LEN);
umem_free(clone1name, ZFS_MAX_DATASET_NAME_LEN); umem_free(clone1name, ZFS_MAX_DATASET_NAME_LEN);
@ -4507,16 +4515,16 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_dsl_dataset_cleanup(osname, id); ztest_dsl_dataset_cleanup(osname, id);
(void) snprintf(snap1name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap1name, ZFS_MAX_DATASET_NAME_LEN, "%s@s1_%"PRIu64"",
"%s@s1_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(clone1name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(clone1name, ZFS_MAX_DATASET_NAME_LEN, "%s/c1_%"PRIu64"",
"%s/c1_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(snap2name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap2name, ZFS_MAX_DATASET_NAME_LEN, "%s@s2_%"PRIu64"",
"%s@s2_%llu", clone1name, (u_longlong_t)id); clone1name, id);
(void) snprintf(clone2name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(clone2name, ZFS_MAX_DATASET_NAME_LEN, "%s/c2_%"PRIu64"",
"%s/c2_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(snap3name, ZFS_MAX_DATASET_NAME_LEN, (void) snprintf(snap3name, ZFS_MAX_DATASET_NAME_LEN, "%s@s3_%"PRIu64"",
"%s@s3_%llu", clone1name, (u_longlong_t)id); clone1name, id);
error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1); error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1);
if (error && error != EEXIST) { if (error && error != EEXIST) {
@ -4524,7 +4532,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error); fatal(B_FALSE, "dmu_take_snapshot(%s) = %d", snap1name, error);
} }
error = dmu_objset_clone(clone1name, snap1name); error = dmu_objset_clone(clone1name, snap1name);
@ -4533,7 +4541,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_objset_create(%s) = %d", clone1name, error); fatal(B_FALSE, "dmu_objset_create(%s) = %d", clone1name, error);
} }
error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1); error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1);
@ -4542,7 +4550,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error); fatal(B_FALSE, "dmu_open_snapshot(%s) = %d", snap2name, error);
} }
error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1); error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1);
@ -4551,7 +4559,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error); fatal(B_FALSE, "dmu_open_snapshot(%s) = %d", snap3name, error);
} }
error = dmu_objset_clone(clone2name, snap3name); error = dmu_objset_clone(clone2name, snap3name);
@ -4560,13 +4568,13 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc(FTAG); ztest_record_enospc(FTAG);
goto out; goto out;
} }
fatal(0, "dmu_objset_create(%s) = %d", clone2name, error); fatal(B_FALSE, "dmu_objset_create(%s) = %d", clone2name, error);
} }
error = ztest_dmu_objset_own(snap2name, DMU_OST_ANY, B_TRUE, B_TRUE, error = ztest_dmu_objset_own(snap2name, DMU_OST_ANY, B_TRUE, B_TRUE,
FTAG, &os); FTAG, &os);
if (error) if (error)
fatal(0, "dmu_objset_own(%s) = %d", snap2name, error); fatal(B_FALSE, "dmu_objset_own(%s) = %d", snap2name, error);
error = dsl_dataset_promote(clone2name, NULL); error = dsl_dataset_promote(clone2name, NULL);
if (error == ENOSPC) { if (error == ENOSPC) {
dmu_objset_disown(os, B_TRUE, FTAG); dmu_objset_disown(os, B_TRUE, FTAG);
@ -4574,8 +4582,8 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
goto out; goto out;
} }
if (error != EBUSY) if (error != EBUSY)
fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name, fatal(B_FALSE, "dsl_dataset_promote(%s), %d, not EBUSY",
error); clone2name, error);
dmu_objset_disown(os, B_TRUE, FTAG); dmu_objset_disown(os, B_TRUE, FTAG);
out: out:
@ -4662,8 +4670,8 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
size = sizeof (ztest_od_t) * OD_ARRAY_SIZE; size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
od = umem_alloc(size, UMEM_NOFAIL); od = umem_alloc(size, UMEM_NOFAIL);
dmu_tx_t *tx; dmu_tx_t *tx;
int i, freeit, error; int freeit, error;
uint64_t n, s, txg; uint64_t i, n, s, txg;
bufwad_t *packbuf, *bigbuf, *pack, *bigH, *bigT; bufwad_t *packbuf, *bigbuf, *pack, *bigH, *bigT;
uint64_t packobj, packoff, packsize, bigobj, bigoff, bigsize; uint64_t packobj, packoff, packsize, bigobj, bigoff, bigsize;
uint64_t chunksize = (1000 + ztest_random(1000)) * sizeof (uint64_t); uint64_t chunksize = (1000 + ztest_random(1000)) * sizeof (uint64_t);
@ -4810,18 +4818,22 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
ASSERT3U((uintptr_t)bigT - (uintptr_t)bigbuf, <, bigsize); ASSERT3U((uintptr_t)bigT - (uintptr_t)bigbuf, <, bigsize);
if (pack->bw_txg > txg) if (pack->bw_txg > txg)
fatal(0, "future leak: got %llx, open txg is %llx", fatal(B_FALSE,
"future leak: got %"PRIx64", open txg is %"PRIx64"",
pack->bw_txg, txg); pack->bw_txg, txg);
if (pack->bw_data != 0 && pack->bw_index != n + i) if (pack->bw_data != 0 && pack->bw_index != n + i)
fatal(0, "wrong index: got %llx, wanted %llx+%llx", fatal(B_FALSE, "wrong index: "
"got %"PRIx64", wanted %"PRIx64"+%"PRIx64"",
pack->bw_index, n, i); pack->bw_index, n, i);
if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0) if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0)
fatal(0, "pack/bigH mismatch in %p/%p", pack, bigH); fatal(B_FALSE, "pack/bigH mismatch in %p/%p",
pack, bigH);
if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0) if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0)
fatal(0, "pack/bigT mismatch in %p/%p", pack, bigT); fatal(B_FALSE, "pack/bigT mismatch in %p/%p",
pack, bigT);
if (freeit) { if (freeit) {
bzero(pack, sizeof (bufwad_t)); bzero(pack, sizeof (bufwad_t));
@ -4842,20 +4854,16 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
if (freeit) { if (freeit) {
if (ztest_opts.zo_verbose >= 7) { if (ztest_opts.zo_verbose >= 7) {
(void) printf("freeing offset %llx size %llx" (void) printf("freeing offset %"PRIx64" size %"PRIx64""
" txg %llx\n", " txg %"PRIx64"\n",
(u_longlong_t)bigoff, bigoff, bigsize, txg);
(u_longlong_t)bigsize,
(u_longlong_t)txg);
} }
VERIFY0(dmu_free_range(os, bigobj, bigoff, bigsize, tx)); VERIFY0(dmu_free_range(os, bigobj, bigoff, bigsize, tx));
} else { } else {
if (ztest_opts.zo_verbose >= 7) { if (ztest_opts.zo_verbose >= 7) {
(void) printf("writing offset %llx size %llx" (void) printf("writing offset %"PRIx64" size %"PRIx64""
" txg %llx\n", " txg %"PRIx64"\n",
(u_longlong_t)bigoff, bigoff, bigsize, txg);
(u_longlong_t)bigsize,
(u_longlong_t)txg);
} }
dmu_write(os, bigobj, bigoff, bigsize, bigbuf, tx); dmu_write(os, bigobj, bigoff, bigsize, bigbuf, tx);
} }
@ -4913,18 +4921,22 @@ compare_and_update_pbbufs(uint64_t s, bufwad_t *packbuf, bufwad_t *bigbuf,
ASSERT3U((uintptr_t)bigT - (uintptr_t)bigbuf, <, bigsize); ASSERT3U((uintptr_t)bigT - (uintptr_t)bigbuf, <, bigsize);
if (pack->bw_txg > txg) if (pack->bw_txg > txg)
fatal(0, "future leak: got %llx, open txg is %llx", fatal(B_FALSE,
"future leak: got %"PRIx64", open txg is %"PRIx64"",
pack->bw_txg, txg); pack->bw_txg, txg);
if (pack->bw_data != 0 && pack->bw_index != n + i) if (pack->bw_data != 0 && pack->bw_index != n + i)
fatal(0, "wrong index: got %llx, wanted %llx+%llx", fatal(B_FALSE, "wrong index: "
"got %"PRIx64", wanted %"PRIx64"+%"PRIx64"",
pack->bw_index, n, i); pack->bw_index, n, i);
if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0) if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0)
fatal(0, "pack/bigH mismatch in %p/%p", pack, bigH); fatal(B_FALSE, "pack/bigH mismatch in %p/%p",
pack, bigH);
if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0) if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0)
fatal(0, "pack/bigT mismatch in %p/%p", pack, bigT); fatal(B_FALSE, "pack/bigT mismatch in %p/%p",
pack, bigT);
pack->bw_index = n + i; pack->bw_index = n + i;
pack->bw_txg = txg; pack->bw_txg = txg;
@ -5103,11 +5115,9 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
*/ */
dmu_write(os, packobj, packoff, packsize, packbuf, tx); dmu_write(os, packobj, packoff, packsize, packbuf, tx);
if (ztest_opts.zo_verbose >= 7) { if (ztest_opts.zo_verbose >= 7) {
(void) printf("writing offset %llx size %llx" (void) printf("writing offset %"PRIx64" size %"PRIx64""
" txg %llx\n", " txg %"PRIx64"\n",
(u_longlong_t)bigoff, bigoff, bigsize, txg);
(u_longlong_t)bigsize,
(u_longlong_t)txg);
} }
for (off = bigoff, j = 0; j < s; j++, off += chunksize) { for (off = bigoff, j = 0; j < s; j++, off += chunksize) {
dmu_buf_t *dbt; dmu_buf_t *dbt;
@ -5308,8 +5318,8 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
ints = MAX(ZTEST_ZAP_MIN_INTS, object % ZTEST_ZAP_MAX_INTS); ints = MAX(ZTEST_ZAP_MIN_INTS, object % ZTEST_ZAP_MAX_INTS);
prop = ztest_random(ZTEST_ZAP_MAX_PROPS); prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
(void) sprintf(propname, "prop_%llu", (u_longlong_t)prop); (void) sprintf(propname, "prop_%"PRIu64"", prop);
(void) sprintf(txgname, "txg_%llu", (u_longlong_t)prop); (void) sprintf(txgname, "txg_%"PRIu64"", prop);
bzero(value, sizeof (value)); bzero(value, sizeof (value));
last_txg = 0; last_txg = 0;
@ -5354,7 +5364,8 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
goto out; goto out;
if (last_txg > txg) if (last_txg > txg)
fatal(0, "zap future leak: old %llu new %llu", last_txg, txg); fatal(B_FALSE, "zap future leak: old %"PRIu64" new %"PRIu64"",
last_txg, txg);
for (i = 0; i < ints; i++) for (i = 0; i < ints; i++)
value[i] = txg + object + i; value[i] = txg + object + i;
@ -5370,8 +5381,8 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
* Remove a random pair of entries. * Remove a random pair of entries.
*/ */
prop = ztest_random(ZTEST_ZAP_MAX_PROPS); prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
(void) sprintf(propname, "prop_%llu", (u_longlong_t)prop); (void) sprintf(propname, "prop_%"PRIu64"", prop);
(void) sprintf(txgname, "txg_%llu", (u_longlong_t)prop); (void) sprintf(txgname, "txg_%"PRIu64"", prop);
error = zap_length(os, object, txgname, &zl_intsize, &zl_ints); error = zap_length(os, object, txgname, &zl_intsize, &zl_ints);
@ -5400,8 +5411,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id)
{ {
objset_t *os = zd->zd_os; objset_t *os = zd->zd_os;
ztest_od_t *od; ztest_od_t *od;
uint64_t object, txg; uint64_t object, txg, value;
int i;
od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL); od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0, 0); ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0, 0);
@ -5416,14 +5426,13 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id)
* and gets upgraded to a fatzap. Also, since we are adding * and gets upgraded to a fatzap. Also, since we are adding
* 2050 entries we should see ptrtbl growth and leaf-block split. * 2050 entries we should see ptrtbl growth and leaf-block split.
*/ */
for (i = 0; i < 2050; i++) { for (value = 0; value < 2050; value++) {
char name[ZFS_MAX_DATASET_NAME_LEN]; char name[ZFS_MAX_DATASET_NAME_LEN];
uint64_t value = i;
dmu_tx_t *tx; dmu_tx_t *tx;
int error; int error;
(void) snprintf(name, sizeof (name), "fzap-%llu-%llu", (void) snprintf(name, sizeof (name), "fzap-%"PRIu64"-%"PRIu64"",
(u_longlong_t)id, (u_longlong_t)value); id, value);
tx = dmu_tx_create(os); tx = dmu_tx_create(os);
dmu_tx_hold_zap(tx, object, B_TRUE, name); dmu_tx_hold_zap(tx, object, B_TRUE, name);
@ -5527,8 +5536,8 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id)
if (error == 0) { if (error == 0) {
if (data == string_value && if (data == string_value &&
bcmp(name, data, namelen) != 0) bcmp(name, data, namelen) != 0)
fatal(0, "name '%s' != val '%s' len %d", fatal(B_FALSE, "name '%s' != val '%s' len %d",
name, data, namelen); name, (char *)data, namelen);
} else { } else {
ASSERT3U(error, ==, ENOENT); ASSERT3U(error, ==, ENOENT);
} }
@ -5580,9 +5589,10 @@ ztest_commit_callback(void *arg, int error)
synced_txg = spa_last_synced_txg(data->zcd_spa); synced_txg = spa_last_synced_txg(data->zcd_spa);
if (data->zcd_txg > synced_txg) if (data->zcd_txg > synced_txg)
fatal(0, "commit callback of txg %" PRIu64 " called prematurely" fatal(B_FALSE,
", last synced txg = %" PRIu64 "\n", data->zcd_txg, "commit callback of txg %"PRIu64" called prematurely, "
synced_txg); "last synced txg = %"PRIu64"\n",
data->zcd_txg, synced_txg);
data->zcd_called = B_TRUE; data->zcd_called = B_TRUE;
@ -5704,7 +5714,8 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
&old_txg, DMU_READ_PREFETCH)); &old_txg, DMU_READ_PREFETCH));
if (old_txg > txg) if (old_txg > txg)
fatal(0, "future leak: got %" PRIu64 ", open txg is %" PRIu64, fatal(B_FALSE,
"future leak: got %"PRIu64", open txg is %"PRIu64"",
old_txg, txg); old_txg, txg);
dmu_write(os, od->od_object, 0, sizeof (uint64_t), &txg, tx); dmu_write(os, od->od_object, 0, sizeof (uint64_t), &txg, tx);
@ -5726,8 +5737,10 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
tmp_cb = list_head(&zcl.zcl_callbacks); tmp_cb = list_head(&zcl.zcl_callbacks);
if (tmp_cb != NULL && if (tmp_cb != NULL &&
tmp_cb->zcd_txg + ZTEST_COMMIT_CB_THRESH < txg) { tmp_cb->zcd_txg + ZTEST_COMMIT_CB_THRESH < txg) {
fatal(0, "Commit callback threshold exceeded, oldest txg: %" fatal(B_FALSE,
PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg); "Commit callback threshold exceeded, "
"oldest txg: %"PRIu64", open txg: %"PRIu64"\n",
tmp_cb->zcd_txg, txg);
} }
/* /*
@ -5885,12 +5898,11 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
dmu_objset_name(os, osname); dmu_objset_name(os, osname);
(void) snprintf(snapname, sizeof (snapname), "sh1_%llu", (void) snprintf(snapname, sizeof (snapname), "sh1_%"PRIu64"", id);
(u_longlong_t)id);
(void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname); (void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname);
(void) snprintf(clonename, sizeof (clonename), (void) snprintf(clonename, sizeof (clonename), "%s/ch1_%"PRIu64"",
"%s/ch1_%llu", osname, (u_longlong_t)id); osname, id);
(void) snprintf(tag, sizeof (tag), "tag_%llu", (u_longlong_t)id); (void) snprintf(tag, sizeof (tag), "tag_%"PRIu64"", id);
/* /*
* Clean up from any previous run. * Clean up from any previous run.
@ -5915,7 +5927,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc("dmu_objset_snapshot"); ztest_record_enospc("dmu_objset_snapshot");
goto out; goto out;
} }
fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error); fatal(B_FALSE, "dmu_objset_snapshot(%s) = %d", fullname, error);
} }
error = dmu_objset_clone(clonename, fullname); error = dmu_objset_clone(clonename, fullname);
@ -5924,22 +5936,22 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc("dmu_objset_clone"); ztest_record_enospc("dmu_objset_clone");
goto out; goto out;
} }
fatal(0, "dmu_objset_clone(%s) = %d", clonename, error); fatal(B_FALSE, "dmu_objset_clone(%s) = %d", clonename, error);
} }
error = dsl_destroy_snapshot(fullname, B_TRUE); error = dsl_destroy_snapshot(fullname, B_TRUE);
if (error) { if (error) {
fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d", fatal(B_FALSE, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
fullname, error); fullname, error);
} }
error = dsl_destroy_head(clonename); error = dsl_destroy_head(clonename);
if (error) if (error)
fatal(0, "dsl_destroy_head(%s) = %d", clonename, error); fatal(B_FALSE, "dsl_destroy_head(%s) = %d", clonename, error);
error = dmu_objset_hold(fullname, FTAG, &origin); error = dmu_objset_hold(fullname, FTAG, &origin);
if (error != ENOENT) if (error != ENOENT)
fatal(0, "dmu_objset_hold(%s) = %d", fullname, error); fatal(B_FALSE, "dmu_objset_hold(%s) = %d", fullname, error);
/* /*
* Create snapshot, add temporary hold, verify that we can't * Create snapshot, add temporary hold, verify that we can't
@ -5952,7 +5964,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc("dmu_objset_snapshot"); ztest_record_enospc("dmu_objset_snapshot");
goto out; goto out;
} }
fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error); fatal(B_FALSE, "dmu_objset_snapshot(%s) = %d", fullname, error);
} }
holds = fnvlist_alloc(); holds = fnvlist_alloc();
@ -5964,25 +5976,26 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
ztest_record_enospc("dsl_dataset_user_hold"); ztest_record_enospc("dsl_dataset_user_hold");
goto out; goto out;
} else if (error) { } else if (error) {
fatal(0, "dsl_dataset_user_hold(%s, %s) = %u", fatal(B_FALSE, "dsl_dataset_user_hold(%s, %s) = %u",
fullname, tag, error); fullname, tag, error);
} }
error = dsl_destroy_snapshot(fullname, B_FALSE); error = dsl_destroy_snapshot(fullname, B_FALSE);
if (error != EBUSY) { if (error != EBUSY) {
fatal(0, "dsl_destroy_snapshot(%s, B_FALSE) = %d", fatal(B_FALSE, "dsl_destroy_snapshot(%s, B_FALSE) = %d",
fullname, error); fullname, error);
} }
error = dsl_destroy_snapshot(fullname, B_TRUE); error = dsl_destroy_snapshot(fullname, B_TRUE);
if (error) { if (error) {
fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d", fatal(B_FALSE, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
fullname, error); fullname, error);
} }
error = user_release_one(fullname, tag); error = user_release_one(fullname, tag);
if (error) if (error)
fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error); fatal(B_FALSE, "user_release_one(%s, %s) = %d",
fullname, tag, error);
VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT); VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT);
@ -6263,14 +6276,15 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
} }
if (pwrite(fd, &bad, sizeof (bad), offset) != sizeof (bad)) if (pwrite(fd, &bad, sizeof (bad), offset) != sizeof (bad))
fatal(1, "can't inject bad word at 0x%llx in %s", fatal(B_TRUE,
"can't inject bad word at 0x%"PRIx64" in %s",
offset, pathrand); offset, pathrand);
mutex_exit(&ztest_vdev_lock); mutex_exit(&ztest_vdev_lock);
if (ztest_opts.zo_verbose >= 7) if (ztest_opts.zo_verbose >= 7)
(void) printf("injected bad word into %s," (void) printf("injected bad word into %s,"
" offset 0x%llx\n", pathrand, (u_longlong_t)offset); " offset 0x%"PRIx64"\n", pathrand, offset);
} }
(void) close(fd); (void) close(fd);
@ -6358,8 +6372,8 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id)
return; return;
if (ztest_opts.zo_verbose >= 4) { if (ztest_opts.zo_verbose >= 4) {
(void) printf("Changed guid old %llu -> %llu\n", (void) printf("Changed guid old %"PRIu64" -> %"PRIu64"\n",
(u_longlong_t)orig, (u_longlong_t)spa_guid(spa)); orig, spa_guid(spa));
} }
VERIFY3U(orig, !=, spa_guid(spa)); VERIFY3U(orig, !=, spa_guid(spa));
@ -6600,7 +6614,7 @@ ztest_get_zdb_bin(char *bin, int len)
strlcpy(bin, zdb_path, len); /* In env */ strlcpy(bin, zdb_path, len); /* In env */
if (!ztest_check_path(bin)) { if (!ztest_check_path(bin)) {
ztest_dump_core = 0; ztest_dump_core = 0;
fatal(1, "invalid ZDB_PATH '%s'", bin); fatal(B_TRUE, "invalid ZDB_PATH '%s'", bin);
} }
return; return;
} }
@ -6840,9 +6854,10 @@ ztest_run_zdb(char *pool)
ztest_dump_core = 0; ztest_dump_core = 0;
if (WIFEXITED(status)) if (WIFEXITED(status))
fatal(0, "'%s' exit code %d", zdb, WEXITSTATUS(status)); fatal(B_FALSE, "'%s' exit code %d", zdb, WEXITSTATUS(status));
else else
fatal(0, "'%s' died with signal %d", zdb, WTERMSIG(status)); fatal(B_FALSE, "'%s' died with signal %d",
zdb, WTERMSIG(status));
out: out:
umem_free(bin, len); umem_free(bin, len);
umem_free(zdb, len); umem_free(zdb, len);
@ -7013,7 +7028,8 @@ ztest_deadman_thread(void *arg)
* I/Os then it will end up aborting the tests. * I/Os then it will end up aborting the tests.
*/ */
if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { if (spa_suspended(spa) || spa->spa_root_vdev == NULL) {
fatal(0, "aborting test after %llu seconds because " fatal(B_FALSE,
"aborting test after %lu seconds because "
"pool has transitioned to a suspended state.", "pool has transitioned to a suspended state.",
zfs_deadman_synctime_ms / 1000); zfs_deadman_synctime_ms / 1000);
} }
@ -7026,7 +7042,8 @@ ztest_deadman_thread(void *arg)
*/ */
overdue = zs->zs_proc_stop + MSEC2NSEC(zfs_deadman_synctime_ms); overdue = zs->zs_proc_stop + MSEC2NSEC(zfs_deadman_synctime_ms);
if (gethrtime() > overdue) { if (gethrtime() > overdue) {
fatal(0, "aborting test after %llu seconds because " fatal(B_FALSE,
"aborting test after %llu seconds because "
"the process is overdue for termination.", "the process is overdue for termination.",
(gethrtime() - zs->zs_proc_start) / NANOSEC); (gethrtime() - zs->zs_proc_start) / NANOSEC);
} }
@ -7187,7 +7204,8 @@ ztest_dataset_open(int d)
if (zilog->zl_header->zh_claim_lr_seq != 0 && if (zilog->zl_header->zh_claim_lr_seq != 0 &&
zilog->zl_header->zh_claim_lr_seq < committed_seq) zilog->zl_header->zh_claim_lr_seq < committed_seq)
fatal(0, "missing log records: claimed %llu < committed %llu", fatal(B_FALSE, "missing log records: "
"claimed %"PRIu64" < committed %"PRIu64"",
zilog->zl_header->zh_claim_lr_seq, committed_seq); zilog->zl_header->zh_claim_lr_seq, committed_seq);
ztest_dataset_dirobj_verify(zd); ztest_dataset_dirobj_verify(zd);
@ -7197,17 +7215,19 @@ ztest_dataset_open(int d)
ztest_dataset_dirobj_verify(zd); ztest_dataset_dirobj_verify(zd);
if (ztest_opts.zo_verbose >= 6) if (ztest_opts.zo_verbose >= 6)
(void) printf("%s replay %llu blocks, %llu records, seq %llu\n", (void) printf("%s replay %"PRIu64" blocks, "
"%"PRIu64" records, seq %"PRIu64"\n",
zd->zd_name, zd->zd_name,
(u_longlong_t)zilog->zl_parse_blk_count, zilog->zl_parse_blk_count,
(u_longlong_t)zilog->zl_parse_lr_count, zilog->zl_parse_lr_count,
(u_longlong_t)zilog->zl_replaying_seq); zilog->zl_replaying_seq);
zilog = zil_open(os, ztest_get_data); zilog = zil_open(os, ztest_get_data);
if (zilog->zl_replaying_seq != 0 && if (zilog->zl_replaying_seq != 0 &&
zilog->zl_replaying_seq < committed_seq) zilog->zl_replaying_seq < committed_seq)
fatal(0, "missing log records: replayed %llu < committed %llu", fatal(B_FALSE, "missing log records: "
"replayed %"PRIu64" < committed %"PRIu64"",
zilog->zl_replaying_seq, committed_seq); zilog->zl_replaying_seq, committed_seq);
return (0); return (0);
@ -7244,11 +7264,12 @@ ztest_replay_zil_cb(const char *name, void *arg)
ztest_opts.zo_verbose >= 6) { ztest_opts.zo_verbose >= 6) {
zilog_t *zilog = dmu_objset_zil(os); zilog_t *zilog = dmu_objset_zil(os);
(void) printf("%s replay %llu blocks, %llu records, seq %llu\n", (void) printf("%s replay %"PRIu64" blocks, "
"%"PRIu64" records, seq %"PRIu64"\n",
name, name,
(u_longlong_t)zilog->zl_parse_blk_count, zilog->zl_parse_blk_count,
(u_longlong_t)zilog->zl_parse_lr_count, zilog->zl_parse_lr_count,
(u_longlong_t)zilog->zl_replaying_seq); zilog->zl_replaying_seq);
} }
umem_free(zdtmp, sizeof (ztest_ds_t)); umem_free(zdtmp, sizeof (ztest_ds_t));
@ -7845,7 +7866,7 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
} }
if (pid == -1) if (pid == -1)
fatal(1, "fork failed"); fatal(B_TRUE, "fork failed");
if (pid == 0) { /* child */ if (pid == 0) { /* child */
char *emptyargv[2] = { cmd, NULL }; char *emptyargv[2] = { cmd, NULL };
@ -7894,7 +7915,6 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
} else { } else {
(void) fprintf(stderr, "something strange happened to child\n"); (void) fprintf(stderr, "something strange happened to child\n");
exit(4); exit(4);
/* NOTREACHED */
} }
} }
@ -8044,14 +8064,14 @@ main(int argc, char **argv)
hasalt = (strlen(ztest_opts.zo_alt_ztest) != 0); hasalt = (strlen(ztest_opts.zo_alt_ztest) != 0);
if (ztest_opts.zo_verbose >= 1) { if (ztest_opts.zo_verbose >= 1) {
(void) printf("%llu vdevs, %d datasets, %d threads," (void) printf("%"PRIu64" vdevs, %d datasets, %d threads,"
"%d %s disks, %llu seconds...\n\n", "%d %s disks, %"PRIu64" seconds...\n\n",
(u_longlong_t)ztest_opts.zo_vdevs, ztest_opts.zo_vdevs,
ztest_opts.zo_datasets, ztest_opts.zo_datasets,
ztest_opts.zo_threads, ztest_opts.zo_threads,
ztest_opts.zo_raid_children, ztest_opts.zo_raid_children,
ztest_opts.zo_raid_type, ztest_opts.zo_raid_type,
(u_longlong_t)ztest_opts.zo_time); ztest_opts.zo_time);
} }
cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL); cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
@ -8133,11 +8153,11 @@ main(int argc, char **argv)
print_time(zs->zs_proc_stop - now, timebuf); print_time(zs->zs_proc_stop - now, timebuf);
nicenum(zs->zs_space, numbuf, sizeof (numbuf)); nicenum(zs->zs_space, numbuf, sizeof (numbuf));
(void) printf("Pass %3d, %8s, %3llu ENOSPC, " (void) printf("Pass %3d, %8s, %3"PRIu64" ENOSPC, "
"%4.1f%% of %5s used, %3.0f%% done, %8s to go\n", "%4.1f%% of %5s used, %3.0f%% done, %8s to go\n",
iters, iters,
WIFEXITED(status) ? "Complete" : "SIGKILL", WIFEXITED(status) ? "Complete" : "SIGKILL",
(u_longlong_t)zs->zs_enospc_count, zs->zs_enospc_count,
100.0 * zs->zs_alloc / zs->zs_space, 100.0 * zs->zs_alloc / zs->zs_space,
numbuf, numbuf,
100.0 * (now - zs->zs_proc_start) / 100.0 * (now - zs->zs_proc_start) /
@ -8154,8 +8174,8 @@ main(int argc, char **argv)
zi = &ztest_info[f]; zi = &ztest_info[f];
zc = ZTEST_GET_SHARED_CALLSTATE(f); zc = ZTEST_GET_SHARED_CALLSTATE(f);
print_time(zc->zc_time, timebuf); print_time(zc->zc_time, timebuf);
(void) printf("%7llu %9s %s\n", (void) printf("%7"PRIu64" %9s %s\n",
(u_longlong_t)zc->zc_count, timebuf, zc->zc_count, timebuf,
zi->zi_funcname); zi->zi_funcname);
} }
(void) printf("\n"); (void) printf("\n");

View File

@ -25,5 +25,7 @@ checkabi:
storeabi: storeabi:
cd .libs ; \ cd .libs ; \
for lib in $(lib_LTLIBRARIES) ; do \ for lib in $(lib_LTLIBRARIES) ; do \
abidw --no-show-locs $${lib%.la}.so > ../$${lib%.la}.abi ; \ abidw --no-show-locs \
--no-corpus-path \
$${lib%.la}.so > ../$${lib%.la}.abi ; \
done done

View File

@ -42,6 +42,13 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
struct block_device_operations o; struct block_device_operations o;
o.submit_bio = NULL; o.submit_bio = NULL;
]) ])
ZFS_LINUX_TEST_SRC([blk_alloc_disk], [
#include <linux/blkdev.h>
],[
struct gendisk *disk __attribute__ ((unused));
disk = blk_alloc_disk(NUMA_NO_NODE);
])
]) ])
AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
@ -56,6 +63,19 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1, AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
[submit_bio is member of struct block_device_operations]) [submit_bio is member of struct block_device_operations])
dnl #
dnl # Linux 5.14 API Change:
dnl # blk_alloc_queue() + alloc_disk() combo replaced by
dnl # a single call to blk_alloc_disk().
dnl #
AC_MSG_CHECKING([whether blk_alloc_disk() exists])
ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
], [
AC_MSG_RESULT(no)
])
],[ ],[
AC_MSG_RESULT(no) AC_MSG_RESULT(no)

View File

@ -0,0 +1,34 @@
dnl #
dnl # Linux 5.14 adds a change to require set_page_dirty to be manually
dnl # wired up in struct address_space_operations. Determine if this needs
dnl # to be done. This patch set also introduced __set_page_dirty_nobuffers
dnl # declaration in linux/pagemap.h, so these tests look for the presence
dnl # of that function to tell the compiler to assign set_page_dirty in
dnl # module/os/linux/zfs/zpl_file.c
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS], [
ZFS_LINUX_TEST_SRC([vfs_has_set_page_dirty_nobuffers], [
#include <linux/pagemap.h>
#include <linux/fs.h>
static const struct address_space_operations
aops __attribute__ ((unused)) = {
.set_page_dirty = __set_page_dirty_nobuffers,
};
],[])
])
AC_DEFUN([ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS], [
dnl #
dnl # Linux 5.14 change requires set_page_dirty() to be assigned
dnl # in address_space_operations()
dnl #
AC_MSG_CHECKING([__set_page_dirty_nobuffers exists])
ZFS_LINUX_TEST_RESULT([vfs_has_set_page_dirty_nobuffers], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS, 1,
[__set_page_dirty_nobuffers exists])
],[
AC_MSG_RESULT([no])
])
])

View File

@ -132,6 +132,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_SIGNAL_STOP ZFS_AC_KERNEL_SRC_SIGNAL_STOP
ZFS_AC_KERNEL_SRC_SIGINFO ZFS_AC_KERNEL_SRC_SIGINFO
ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
AC_MSG_CHECKING([for available kernel interfaces]) AC_MSG_CHECKING([for available kernel interfaces])
ZFS_LINUX_TEST_COMPILE_ALL([kabi]) ZFS_LINUX_TEST_COMPILE_ALL([kabi])
@ -237,6 +238,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_SIGNAL_STOP ZFS_AC_KERNEL_SIGNAL_STOP
ZFS_AC_KERNEL_SIGINFO ZFS_AC_KERNEL_SIGINFO
ZFS_AC_KERNEL_SET_SPECIAL_STATE ZFS_AC_KERNEL_SET_SPECIAL_STATE
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
]) ])
dnl # dnl #

View File

@ -81,15 +81,18 @@ const char *uu_strerror(uint32_t);
extern void uu_alt_exit(int); extern void uu_alt_exit(int);
extern const char *uu_setpname(char *); extern const char *uu_setpname(char *);
extern const char *uu_getpname(void); extern const char *uu_getpname(void);
/*PRINTFLIKE1*/ extern void uu_warn(const char *, ...)
extern void uu_warn(const char *, ...); __attribute__((format(printf, 1, 2)));
extern void uu_vwarn(const char *, va_list); extern void uu_vwarn(const char *, va_list)
/*PRINTFLIKE1*/ __attribute__((format(printf, 1, 0)));
extern void uu_die(const char *, ...) __NORETURN; extern void uu_die(const char *, ...)
extern void uu_vdie(const char *, va_list) __NORETURN; __attribute__((format(printf, 1, 2))) __NORETURN;
/*PRINTFLIKE2*/ extern void uu_vdie(const char *, va_list)
extern void uu_xdie(int, const char *, ...) __NORETURN; __attribute__((format(printf, 1, 0))) __NORETURN;
extern void uu_vxdie(int, const char *, va_list) __NORETURN; extern void uu_xdie(int, const char *, ...)
__attribute__((format(printf, 2, 3))) __NORETURN;
extern void uu_vxdie(int, const char *, va_list)
__attribute__((format(printf, 2, 0))) __NORETURN;
/* /*
* Exit status functions (not to be used directly) * Exit status functions (not to be used directly)
@ -111,8 +114,8 @@ int uu_check_name(const char *, uint_t);
*/ */
#define UU_NELEM(a) (sizeof (a) / sizeof ((a)[0])) #define UU_NELEM(a) (sizeof (a) / sizeof ((a)[0]))
/*PRINTFLIKE1*/ extern char *uu_msprintf(const char *format, ...)
extern char *uu_msprintf(const char *format, ...); __attribute__((format(printf, 1, 2)));
extern void *uu_zalloc(size_t); extern void *uu_zalloc(size_t);
extern char *uu_strdup(const char *); extern char *uu_strdup(const char *);
extern void uu_free(void *); extern void uu_free(void *);

View File

@ -42,8 +42,7 @@ extern "C" {
void uu_set_error(uint_t); void uu_set_error(uint_t);
/*PRINTFLIKE1*/ void uu_panic(const char *format, ...) __attribute__((format(printf, 1, 2)));
void uu_panic(const char *format, ...);
/* /*

View File

@ -36,97 +36,6 @@
extern "C" { extern "C" {
#endif #endif
/*
* Allow for version tests for compiler bugs and features.
*/
#if defined(__GNUC__)
#define __GNUC_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#else
#define __GNUC_VERSION 0
#endif
#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
#if 0
/*
* analogous to lint's PRINTFLIKEn
*/
#define __sun_attr___PRINTFLIKE__(__n) \
__attribute__((__format__(printf, __n, (__n)+1)))
#define __sun_attr___VPRINTFLIKE__(__n) \
__attribute__((__format__(printf, __n, 0)))
#define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__
#define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__
#else
/*
* Currently the openzfs codebase has a lot of formatting errors
* which are not picked up in the linux build because they're not
* doing formatting checks. LLVM's kprintf implementation doesn't
* actually do format checks!
*
* For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a
* format attribute but also didn't check anything. If one
* replaces it with the above, all of the format issues
* in the codebase show up.
*
* Once those format string issues are addressed, the above
* should be flipped on once again.
*/
#define __sun_attr___PRINTFLIKE__(__n)
#define __sun_attr___VPRINTFLIKE__(__n)
#define __sun_attr___KPRINTFLIKE__(__n)
#define __sun_attr___KVPRINTFLIKE__(__n)
#endif
/*
* This one's pretty obvious -- the function never returns
*/
#define __sun_attr___noreturn__ __attribute__((__noreturn__))
/*
* This is an appropriate label for functions that do not
* modify their arguments, e.g. strlen()
*/
#define __sun_attr___pure__ __attribute__((__pure__))
/*
* This is a stronger form of __pure__. Can be used for functions
* that do not modify their arguments and don't depend on global
* memory.
*/
#define __sun_attr___const__ __attribute__((__const__))
/*
* structure packing like #pragma pack(1)
*/
#define __sun_attr___packed__ __attribute__((__packed__))
#define ___sun_attr_inner(__a) __sun_attr_##__a
#define __sun_attr__(__a) ___sun_attr_inner __a
#else /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
#define __sun_attr__(__a)
#endif /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
/*
* Shorthand versions for readability
*/
#define __PRINTFLIKE(__n) __sun_attr__((__PRINTFLIKE__(__n)))
#define __VPRINTFLIKE(__n) __sun_attr__((__VPRINTFLIKE__(__n)))
#define __KPRINTFLIKE(__n) __sun_attr__((__KPRINTFLIKE__(__n)))
#define __KVPRINTFLIKE(__n) __sun_attr__((__KVPRINTFLIKE__(__n)))
#if defined(_KERNEL) || defined(_STANDALONE)
#define __NORETURN __sun_attr__((__noreturn__))
#endif /* _KERNEL || _STANDALONE */
#define __CONST __sun_attr__((__const__))
#define __PURE __sun_attr__((__pure__))
#if defined(INVARIANTS) && !defined(ZFS_DEBUG) #if defined(INVARIANTS) && !defined(ZFS_DEBUG)
#define ZFS_DEBUG #define ZFS_DEBUG
#undef NDEBUG #undef NDEBUG

View File

@ -49,36 +49,29 @@ extern "C" {
#ifndef _ASM #ifndef _ASM
/*PRINTFLIKE2*/
extern void cmn_err(int, const char *, ...) extern void cmn_err(int, const char *, ...)
__KPRINTFLIKE(2); __attribute__((format(printf, 2, 3)));
extern void vzcmn_err(zoneid_t, int, const char *, __va_list) extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
__KVPRINTFLIKE(3); __attribute__((format(printf, 3, 0)));
extern void vcmn_err(int, const char *, __va_list) extern void vcmn_err(int, const char *, __va_list)
__KVPRINTFLIKE(2); __attribute__((format(printf, 2, 0)));
/*PRINTFLIKE3*/
extern void zcmn_err(zoneid_t, int, const char *, ...) extern void zcmn_err(zoneid_t, int, const char *, ...)
__KPRINTFLIKE(3); __attribute__((format(printf, 3, 4)));
extern void vzprintf(zoneid_t, const char *, __va_list) extern void vzprintf(zoneid_t, const char *, __va_list)
__KVPRINTFLIKE(2); __attribute__((format(printf, 2, 0)));
/*PRINTFLIKE2*/
extern void zprintf(zoneid_t, const char *, ...) extern void zprintf(zoneid_t, const char *, ...)
__KPRINTFLIKE(2); __attribute__((format(printf, 2, 3)));
extern void vuprintf(const char *, __va_list) extern void vuprintf(const char *, __va_list)
__KVPRINTFLIKE(1); __attribute__((format(printf, 1, 0)));
/*PRINTFLIKE1*/
extern void panic(const char *, ...) extern void panic(const char *, ...)
__KPRINTFLIKE(1) __NORETURN; __attribute__((format(printf, 1, 2)));
extern void vpanic(const char *, __va_list)
__KVPRINTFLIKE(1) __NORETURN;
#endif /* !_ASM */ #endif /* !_ASM */

View File

@ -32,9 +32,12 @@
#define CE_PANIC 3 /* panic */ #define CE_PANIC 3 /* panic */
#define CE_IGNORE 4 /* print nothing */ #define CE_IGNORE 4 /* print nothing */
extern void cmn_err(int, const char *, ...); extern void cmn_err(int, const char *, ...)
extern void vcmn_err(int, const char *, va_list); __attribute__((format(printf, 2, 3)));
extern void vpanic(const char *, va_list); extern void vcmn_err(int, const char *, va_list)
__attribute__((format(printf, 2, 0)));
extern void vpanic(const char *, va_list)
__attribute__((format(printf, 1, 0)));
#define fm_panic panic #define fm_panic panic

View File

@ -50,7 +50,6 @@ COMMON_H = \
mntent.h \ mntent.h \
mod.h \ mod.h \
multilist.h \ multilist.h \
note.h \
nvpair.h \ nvpair.h \
nvpair_impl.h \ nvpair_impl.h \
objlist.h \ objlist.h \

View File

@ -91,6 +91,7 @@ abd_t *abd_alloc_linear(size_t, boolean_t);
abd_t *abd_alloc_gang(void); abd_t *abd_alloc_gang(void);
abd_t *abd_alloc_for_io(size_t, boolean_t); abd_t *abd_alloc_for_io(size_t, boolean_t);
abd_t *abd_alloc_sametype(abd_t *, size_t); abd_t *abd_alloc_sametype(abd_t *, size_t);
boolean_t abd_size_alloc_linear(size_t);
void abd_gang_add(abd_t *, abd_t *, boolean_t); void abd_gang_add(abd_t *, abd_t *, boolean_t);
void abd_free(abd_t *); void abd_free(abd_t *);
abd_t *abd_get_offset(abd_t *, size_t); abd_t *abd_get_offset(abd_t *, size_t);

View File

@ -68,7 +68,6 @@ abd_t *abd_get_offset_scatter(abd_t *, abd_t *, size_t, size_t);
void abd_free_struct_impl(abd_t *); void abd_free_struct_impl(abd_t *);
void abd_alloc_chunks(abd_t *, size_t); void abd_alloc_chunks(abd_t *, size_t);
void abd_free_chunks(abd_t *); void abd_free_chunks(abd_t *);
boolean_t abd_size_alloc_linear(size_t);
void abd_update_scatter_stats(abd_t *, abd_stats_op_t); void abd_update_scatter_stats(abd_t *, abd_stats_op_t);
void abd_update_linear_stats(abd_t *, abd_stats_op_t); void abd_update_linear_stats(abd_t *, abd_stats_op_t);
void abd_verify_scatter(abd_t *); void abd_verify_scatter(abd_t *);

View File

@ -49,12 +49,12 @@ extern "C" {
#define HDR_SET_LSIZE(hdr, x) do { \ #define HDR_SET_LSIZE(hdr, x) do { \
ASSERT(IS_P2ALIGNED(x, 1U << SPA_MINBLOCKSHIFT)); \ ASSERT(IS_P2ALIGNED(x, 1U << SPA_MINBLOCKSHIFT)); \
(hdr)->b_lsize = ((x) >> SPA_MINBLOCKSHIFT); \ (hdr)->b_lsize = ((x) >> SPA_MINBLOCKSHIFT); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define HDR_SET_PSIZE(hdr, x) do { \ #define HDR_SET_PSIZE(hdr, x) do { \
ASSERT(IS_P2ALIGNED((x), 1U << SPA_MINBLOCKSHIFT)); \ ASSERT(IS_P2ALIGNED((x), 1U << SPA_MINBLOCKSHIFT)); \
(hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \ (hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT) #define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT)
#define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT) #define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT)

View File

@ -360,7 +360,6 @@ typedef struct l2arc_lb_ptr_buf {
void *tmp = (x);\ void *tmp = (x);\
x = y; \ x = y; \
y = tmp; \ y = tmp; \
_NOTE(CONSTCOND)\
} while (0) } while (0)
#define L2ARC_DEV_HDR_MAGIC 0x5a46534341434845LLU /* ASCII: "ZFSCACHE" */ #define L2ARC_DEV_HDR_MAGIC 0x5a46534341434845LLU /* ASCII: "ZFSCACHE" */

View File

@ -53,13 +53,13 @@ extern "C" {
ASSERT3U(val, <, 1U << (len)); \ ASSERT3U(val, <, 1U << (len)); \
ASSERT3U(low + len, <=, 32); \ ASSERT3U(low + len, <=, 32); \
(x) ^= BF32_ENCODE((x >> low) ^ (val), low, len); \ (x) ^= BF32_ENCODE((x >> low) ^ (val), low, len); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BF64_SET(x, low, len, val) do { \ #define BF64_SET(x, low, len, val) do { \
ASSERT3U(val, <, 1ULL << (len)); \ ASSERT3U(val, <, 1ULL << (len)); \
ASSERT3U(low + len, <=, 64); \ ASSERT3U(low + len, <=, 64); \
((x) ^= BF64_ENCODE((x >> low) ^ (val), low, len)); \ ((x) ^= BF64_ENCODE((x >> low) ^ (val), low, len)); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BF32_GET_SB(x, low, len, shift, bias) \ #define BF32_GET_SB(x, low, len, shift, bias) \
((BF32_GET(x, low, len) + (bias)) << (shift)) ((BF32_GET(x, low, len) + (bias)) << (shift))
@ -69,19 +69,18 @@ _NOTE(CONSTCOND) } while (0)
/* /*
* We use ASSERT3U instead of ASSERT in these macros to prevent a lint error in * We use ASSERT3U instead of ASSERT in these macros to prevent a lint error in
* the case where val is a constant. We can't fix ASSERT because it's used as * the case where val is a constant. We can't fix ASSERT because it's used as
* an expression in several places in the kernel; as a result, changing it to * an expression in several places in the kernel.
* the do{} while() syntax to allow us to _NOTE the CONSTCOND is not an option.
*/ */
#define BF32_SET_SB(x, low, len, shift, bias, val) do { \ #define BF32_SET_SB(x, low, len, shift, bias, val) do { \
ASSERT3U(IS_P2ALIGNED(val, 1U << shift), !=, B_FALSE); \ ASSERT3U(IS_P2ALIGNED(val, 1U << shift), !=, B_FALSE); \
ASSERT3S((val) >> (shift), >=, bias); \ ASSERT3S((val) >> (shift), >=, bias); \
BF32_SET(x, low, len, ((val) >> (shift)) - (bias)); \ BF32_SET(x, low, len, ((val) >> (shift)) - (bias)); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BF64_SET_SB(x, low, len, shift, bias, val) do { \ #define BF64_SET_SB(x, low, len, shift, bias, val) do { \
ASSERT3U(IS_P2ALIGNED(val, 1ULL << shift), !=, B_FALSE); \ ASSERT3U(IS_P2ALIGNED(val, 1ULL << shift), !=, B_FALSE); \
ASSERT3S((val) >> (shift), >=, bias); \ ASSERT3S((val) >> (shift), >=, bias); \
BF64_SET(x, low, len, ((val) >> (shift)) - (bias)); \ BF64_SET(x, low, len, ((val) >> (shift)) - (bias)); \
_NOTE(CONSTCOND) } while (0) } while (0)
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -474,7 +474,7 @@ dbuf_find_dirty_eq(dmu_buf_impl_t *db, uint64_t txg)
__db_buf, (dbuf)->db_level, \ __db_buf, (dbuf)->db_level, \
(u_longlong_t)(dbuf)->db_blkid, __VA_ARGS__); \ (u_longlong_t)(dbuf)->db_blkid, __VA_ARGS__); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#define dprintf_dbuf_bp(db, bp, fmt, ...) do { \ #define dprintf_dbuf_bp(db, bp, fmt, ...) do { \
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \ if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
@ -483,7 +483,7 @@ _NOTE(CONSTCOND) } while (0)
dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf); \ dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \ kmem_free(__blkbuf, BP_SPRINTF_LEN); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#define DBUF_VERIFY(db) dbuf_verify(db) #define DBUF_VERIFY(db) dbuf_verify(db)

View File

@ -607,7 +607,7 @@ extern dnode_stats_t dnode_stats;
dprintf_ds((dn)->dn_objset->os_dsl_dataset, "obj=%s " fmt, \ dprintf_ds((dn)->dn_objset->os_dsl_dataset, "obj=%s " fmt, \
__db_buf, __VA_ARGS__); \ __db_buf, __VA_ARGS__); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#define DNODE_VERIFY(dn) dnode_verify(dn) #define DNODE_VERIFY(dn) dnode_verify(dn)
#define FREE_VERIFY(db, start, end, tx) free_verify(db, start, end, tx) #define FREE_VERIFY(db, start, end, tx) free_verify(db, start, end, tx)

View File

@ -497,7 +497,7 @@ void dsl_dataset_activate_redaction(dsl_dataset_t *ds, uint64_t *redact_snaps,
dprintf("ds=%s " fmt, __ds_name, __VA_ARGS__); \ dprintf("ds=%s " fmt, __ds_name, __VA_ARGS__); \
kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \ kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#else #else
#define dprintf_ds(dd, fmt, ...) #define dprintf_ds(dd, fmt, ...)
#endif #endif

View File

@ -218,7 +218,7 @@ void dsl_dir_cancel_waiters(dsl_dir_t *dd);
dprintf("dd=%s " fmt, __ds_name, __VA_ARGS__); \ dprintf("dd=%s " fmt, __ds_name, __VA_ARGS__); \
kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \ kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#else #else
#define dprintf_dd(dd, fmt, ...) #define dprintf_dd(dd, fmt, ...)
#endif #endif

View File

@ -1,56 +0,0 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright (c) 1994 by Sun Microsystems, Inc.
*/
/*
* sys/note.h: interface for annotating source with info for tools
*
* This is the underlying interface; NOTE (/usr/include/note.h) is the
* preferred interface, but all exported header files should include this
* file directly and use _NOTE so as not to take "NOTE" from the user's
* namespace. For consistency, *all* kernel source should use _NOTE.
*
* By default, annotations expand to nothing. This file implements
* that. Tools using annotations will interpose a different version
* of this file that will expand annotations as needed.
*/
#ifndef _SYS_NOTE_H
#define _SYS_NOTE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _NOTE
#define _NOTE(s)
#endif
#define NOTE(s) _NOTE(s)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NOTE_H */

View File

@ -328,7 +328,7 @@ typedef struct zio_cksum_salt {
#define BPE_SET_ETYPE(bp, t) do { \ #define BPE_SET_ETYPE(bp, t) do { \
ASSERT(BP_IS_EMBEDDED(bp)); \ ASSERT(BP_IS_EMBEDDED(bp)); \
BF64_SET((bp)->blk_prop, 40, 8, t); \ BF64_SET((bp)->blk_prop, 40, 8, t); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BPE_GET_LSIZE(bp) \ #define BPE_GET_LSIZE(bp) \
(ASSERT(BP_IS_EMBEDDED(bp)), \ (ASSERT(BP_IS_EMBEDDED(bp)), \
@ -336,7 +336,7 @@ _NOTE(CONSTCOND) } while (0)
#define BPE_SET_LSIZE(bp, x) do { \ #define BPE_SET_LSIZE(bp, x) do { \
ASSERT(BP_IS_EMBEDDED(bp)); \ ASSERT(BP_IS_EMBEDDED(bp)); \
BF64_SET_SB((bp)->blk_prop, 0, 25, 0, 1, x); \ BF64_SET_SB((bp)->blk_prop, 0, 25, 0, 1, x); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BPE_GET_PSIZE(bp) \ #define BPE_GET_PSIZE(bp) \
(ASSERT(BP_IS_EMBEDDED(bp)), \ (ASSERT(BP_IS_EMBEDDED(bp)), \
@ -344,7 +344,7 @@ _NOTE(CONSTCOND) } while (0)
#define BPE_SET_PSIZE(bp, x) do { \ #define BPE_SET_PSIZE(bp, x) do { \
ASSERT(BP_IS_EMBEDDED(bp)); \ ASSERT(BP_IS_EMBEDDED(bp)); \
BF64_SET_SB((bp)->blk_prop, 25, 7, 0, 1, x); \ BF64_SET_SB((bp)->blk_prop, 25, 7, 0, 1, x); \
_NOTE(CONSTCOND) } while (0) } while (0)
typedef enum bp_embedded_type { typedef enum bp_embedded_type {
BP_EMBEDDED_TYPE_DATA, BP_EMBEDDED_TYPE_DATA,
@ -419,7 +419,7 @@ typedef struct blkptr {
ASSERT(!BP_IS_EMBEDDED(bp)); \ ASSERT(!BP_IS_EMBEDDED(bp)); \
BF64_SET_SB((bp)->blk_prop, \ BF64_SET_SB((bp)->blk_prop, \
0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \ 0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BP_GET_PSIZE(bp) \ #define BP_GET_PSIZE(bp) \
(BP_IS_EMBEDDED(bp) ? 0 : \ (BP_IS_EMBEDDED(bp) ? 0 : \
@ -428,7 +428,7 @@ _NOTE(CONSTCOND) } while (0)
ASSERT(!BP_IS_EMBEDDED(bp)); \ ASSERT(!BP_IS_EMBEDDED(bp)); \
BF64_SET_SB((bp)->blk_prop, \ BF64_SET_SB((bp)->blk_prop, \
16, SPA_PSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \ 16, SPA_PSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BP_GET_COMPRESS(bp) \ #define BP_GET_COMPRESS(bp) \
BF64_GET((bp)->blk_prop, 32, SPA_COMPRESSBITS) BF64_GET((bp)->blk_prop, 32, SPA_COMPRESSBITS)
@ -444,7 +444,7 @@ _NOTE(CONSTCOND) } while (0)
#define BP_SET_CHECKSUM(bp, x) do { \ #define BP_SET_CHECKSUM(bp, x) do { \
ASSERT(!BP_IS_EMBEDDED(bp)); \ ASSERT(!BP_IS_EMBEDDED(bp)); \
BF64_SET((bp)->blk_prop, 40, 8, x); \ BF64_SET((bp)->blk_prop, 40, 8, x); \
_NOTE(CONSTCOND) } while (0) } while (0)
#define BP_GET_TYPE(bp) BF64_GET((bp)->blk_prop, 48, 8) #define BP_GET_TYPE(bp) BF64_GET((bp)->blk_prop, 48, 8)
#define BP_SET_TYPE(bp, x) BF64_SET((bp)->blk_prop, 48, 8, x) #define BP_SET_TYPE(bp, x) BF64_SET((bp)->blk_prop, 48, 8, x)
@ -1056,8 +1056,10 @@ extern uint64_t spa_dirty_data(spa_t *spa);
extern spa_autotrim_t spa_get_autotrim(spa_t *spa); extern spa_autotrim_t spa_get_autotrim(spa_t *spa);
/* Miscellaneous support routines */ /* Miscellaneous support routines */
extern void spa_load_failed(spa_t *spa, const char *fmt, ...); extern void spa_load_failed(spa_t *spa, const char *fmt, ...)
extern void spa_load_note(spa_t *spa, const char *fmt, ...); __attribute__((format(printf, 2, 3)));
extern void spa_load_note(spa_t *spa, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));
extern void spa_activate_mos_feature(spa_t *spa, const char *feature, extern void spa_activate_mos_feature(spa_t *spa, const char *feature,
dmu_tx_t *tx); dmu_tx_t *tx);
extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature); extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature);
@ -1191,7 +1193,7 @@ int param_set_deadman_failmode(ZFS_MODULE_PARAM_ARGS);
dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf); \ dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf); \
kmem_free(__blkbuf, BP_SPRINTF_LEN); \ kmem_free(__blkbuf, BP_SPRINTF_LEN); \
} \ } \
_NOTE(CONSTCOND) } while (0) } while (0)
#else #else
#define dprintf_bp(bp, fmt, ...) #define dprintf_bp(bp, fmt, ...)
#endif #endif

View File

@ -52,7 +52,8 @@ extern int zfs_nocacheflush;
typedef boolean_t vdev_open_children_func_t(vdev_t *vd); typedef boolean_t vdev_open_children_func_t(vdev_t *vd);
extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...); extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));
extern void vdev_dbgmsg_print_tree(vdev_t *, int); extern void vdev_dbgmsg_print_tree(vdev_t *, int);
extern int vdev_open(vdev_t *); extern int vdev_open(vdev_t *);
extern void vdev_open_children(vdev_t *); extern void vdev_open_children(vdev_t *);

View File

@ -41,7 +41,6 @@ extern "C" {
* similar environment. * similar environment.
*/ */
#if defined(__KERNEL__) || defined(_STANDALONE) #if defined(__KERNEL__) || defined(_STANDALONE)
#include <sys/note.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/atomic.h> #include <sys/atomic.h>
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
@ -104,7 +103,6 @@ extern "C" {
#include <ctype.h> #include <ctype.h>
#include <signal.h> #include <signal.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/note.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/cred.h> #include <sys/cred.h>
#include <sys/sysmacros.h> #include <sys/sysmacros.h>

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,6 @@
#include <libintl.h> #include <libintl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/inttypes.h> #include <sys/inttypes.h>
#include <sys/note.h>
#include <stdarg.h> #include <stdarg.h>
#include "libnvpair.h" #include "libnvpair.h"
@ -191,9 +190,9 @@ static int \
nvprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \ nvprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \
nvlist_t *nvl, const char *name, vtype value) \ nvlist_t *nvl, const char *name, vtype value) \
{ \ { \
(void) private; \
(void) nvl; \
FILE *fp = pctl->nvprt_fp; \ FILE *fp = pctl->nvprt_fp; \
NOTE(ARGUNUSED(private)) \
NOTE(ARGUNUSED(nvl)) \
indent(pctl, 1); \ indent(pctl, 1); \
(void) fprintf(fp, pctl->nvprt_nmfmt, name); \ (void) fprintf(fp, pctl->nvprt_nmfmt, name); \
(void) fprintf(fp, vfmt, (ptype)value); \ (void) fprintf(fp, vfmt, (ptype)value); \
@ -224,10 +223,10 @@ static int \
nvaprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \ nvaprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \
nvlist_t *nvl, const char *name, vtype *valuep, uint_t count) \ nvlist_t *nvl, const char *name, vtype *valuep, uint_t count) \
{ \ { \
(void) private; \
(void) nvl; \
FILE *fp = pctl->nvprt_fp; \ FILE *fp = pctl->nvprt_fp; \
uint_t i; \ uint_t i; \
NOTE(ARGUNUSED(private)) \
NOTE(ARGUNUSED(nvl)) \
for (i = 0; i < count; i++) { \ for (i = 0; i < count; i++) { \
if (i == 0 || pctl->nvprt_btwnarrfmt_nl) { \ if (i == 0 || pctl->nvprt_btwnarrfmt_nl) { \
indent(pctl, 1); \ indent(pctl, 1); \

View File

@ -98,6 +98,4 @@
#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) #define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
#endif #endif
#define _NOTE(x)
#endif /* _LIBSPL_SYS_SYSMACROS_H */ #endif /* _LIBSPL_SYS_SYSMACROS_H */

File diff suppressed because it is too large Load Diff

View File

@ -38,9 +38,6 @@
#include <wchar.h> #include <wchar.h>
#include <unistd.h> #include <unistd.h>
static const char PNAME_FMT[] = "%s: ";
static const char ERRNO_FMT[] = ": %s\n";
static const char *pname; static const char *pname;
static void static void
@ -85,16 +82,16 @@ uu_alt_exit(int profile)
} }
} }
static void static __attribute__((format(printf, 2, 0))) void
uu_warn_internal(int err, const char *format, va_list alist) uu_warn_internal(int err, const char *format, va_list alist)
{ {
if (pname != NULL) if (pname != NULL)
(void) fprintf(stderr, PNAME_FMT, pname); (void) fprintf(stderr, "%s: ", pname);
(void) vfprintf(stderr, format, alist); (void) vfprintf(stderr, format, alist);
if (strrchr(format, '\n') == NULL) if (strrchr(format, '\n') == NULL)
(void) fprintf(stderr, ERRNO_FMT, strerror(err)); (void) fprintf(stderr, ": %s\n", strerror(err));
} }
void void
@ -103,7 +100,6 @@ uu_vwarn(const char *format, va_list alist)
uu_warn_internal(errno, format, alist); uu_warn_internal(errno, format, alist);
} }
/*PRINTFLIKE1*/
void void
uu_warn(const char *format, ...) uu_warn(const char *format, ...)
{ {
@ -113,7 +109,7 @@ uu_warn(const char *format, ...)
va_end(alist); va_end(alist);
} }
static void static __attribute__((format(printf, 2, 0))) __NORETURN void
uu_die_internal(int status, const char *format, va_list alist) uu_die_internal(int status, const char *format, va_list alist)
{ {
uu_warn_internal(errno, format, alist); uu_warn_internal(errno, format, alist);
@ -137,7 +133,6 @@ uu_vdie(const char *format, va_list alist)
uu_die_internal(UU_EXIT_FATAL, format, alist); uu_die_internal(UU_EXIT_FATAL, format, alist);
} }
/*PRINTFLIKE1*/
void void
uu_die(const char *format, ...) uu_die(const char *format, ...)
{ {
@ -153,7 +148,6 @@ uu_vxdie(int status, const char *format, va_list alist)
uu_die_internal(status, format, alist); uu_die_internal(status, format, alist);
} }
/*PRINTFLIKE2*/
void void
uu_xdie(int status, const char *format, ...) uu_xdie(int status, const char *format, ...)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -486,7 +486,7 @@ get_key_material_file(libzfs_handle_t *hdl, const char *uri,
ret = errno; ret = errno;
errno = 0; errno = 0;
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"Failed to open key material file")); "Failed to open key material file: %s"), strerror(ret));
return (ret); return (ret);
} }

View File

@ -1364,8 +1364,8 @@ badlabel:
goto error; goto error;
} }
} }
/* FALLTHROUGH */
/*FALLTHRU*/
case ZFS_PROP_SHARESMB: case ZFS_PROP_SHARESMB:
case ZFS_PROP_SHARENFS: case ZFS_PROP_SHARENFS:

View File

@ -304,7 +304,6 @@ libzfs_error_description(libzfs_handle_t *hdl)
} }
} }
/*PRINTFLIKE2*/
void void
zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...) zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...)
{ {
@ -352,7 +351,6 @@ zfs_error(libzfs_handle_t *hdl, int error, const char *msg)
return (zfs_error_fmt(hdl, error, "%s", msg)); return (zfs_error_fmt(hdl, error, "%s", msg));
} }
/*PRINTFLIKE3*/
int int
zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...) zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
{ {
@ -403,7 +401,6 @@ zfs_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
return (zfs_standard_error_fmt(hdl, error, "%s", msg)); return (zfs_standard_error_fmt(hdl, error, "%s", msg));
} }
/*PRINTFLIKE3*/
int int
zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...) zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
{ {
@ -613,7 +610,6 @@ zpool_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
return (zpool_standard_error_fmt(hdl, error, "%s", msg)); return (zpool_standard_error_fmt(hdl, error, "%s", msg));
} }
/*PRINTFLIKE3*/
int int
zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...) zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
{ {
@ -771,7 +767,6 @@ zfs_alloc(libzfs_handle_t *hdl, size_t size)
/* /*
* A safe form of asprintf() which will die if the allocation fails. * A safe form of asprintf() which will die if the allocation fails.
*/ */
/*PRINTFLIKE2*/
char * char *
zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...) zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,12 @@
<abi-corpus path='libzfsbootenv.so' architecture='elf-amd-x86_64' soname='libzfsbootenv.so.1'> <abi-corpus architecture='elf-amd-x86_64' soname='libzfsbootenv.so.1'>
<elf-needed> <elf-needed>
<dependency name='libzfs.so.4'/> <dependency name='libzfs.so.4'/>
<dependency name='libzfs_core.so.3'/>
<dependency name='libuuid.so.1'/>
<dependency name='libblkid.so.1'/>
<dependency name='libudev.so.1'/>
<dependency name='libuutil.so.3'/>
<dependency name='libm.so.6'/>
<dependency name='libcrypto.so.1.1'/>
<dependency name='libz.so.1'/>
<dependency name='libnvpair.so.3'/> <dependency name='libnvpair.so.3'/>
<dependency name='libtirpc.so.3'/>
<dependency name='libpthread.so.0'/>
<dependency name='libc.so.6'/> <dependency name='libc.so.6'/>
</elf-needed> </elf-needed>
<elf-function-symbols> <elf-function-symbols>
<elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='lzbe_add_pair' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='lzbe_add_pair' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='lzbe_bootenv_print' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='lzbe_bootenv_print' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='lzbe_get_boot_device' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='lzbe_get_boot_device' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@ -24,189 +16,346 @@
<elf-symbol name='lzbe_remove_pair' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='lzbe_remove_pair' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='lzbe_set_boot_device' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/> <elf-symbol name='lzbe_set_boot_device' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
</elf-function-symbols> </elf-function-symbols>
<abi-instr version='1.0' address-size='64' path='lzbe_device.c' comp-dir-path='/home/fedora/zfs/lib/libzfsbootenv' language='LANG_C99'> <abi-instr version='1.0' address-size='64' path='lzbe_device.c' comp-dir-path='/home/runner/work/zfs/zfs/lib/libzfsbootenv' language='LANG_C99'>
<type-decl name='char' size-in-bits='8' id='type-id-1'/> <type-decl name='int' size-in-bits='32' id='type-id-1'/>
<type-decl name='int' size-in-bits='32' id='type-id-2'/> <type-decl name='char' size-in-bits='8' id='type-id-2'/>
<type-decl name='unnamed-enum-underlying-type' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='type-id-3'/> <qualified-type-def type-id='type-id-2' const='yes' id='type-id-3'/>
<typedef-decl name='lzbe_flags_t' type-id='type-id-4' filepath='../../include/libzfsbootenv.h' line='26' column='1' id='type-id-5'/> <pointer-type-def type-id='type-id-3' size-in-bits='64' id='type-id-4'/>
<enum-decl name='lzbe_flags' filepath='../../include/libzfsbootenv.h' line='23' column='1' id='type-id-4'> <pointer-type-def type-id='type-id-2' size-in-bits='64' id='type-id-5'/>
<underlying-type type-id='type-id-3'/> <pointer-type-def type-id='type-id-5' size-in-bits='64' id='type-id-6'/>
<function-decl name='lzbe_get_boot_device' mangled-name='lzbe_get_boot_device' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_get_boot_device'>
<parameter type-id='type-id-4' name='pool'/>
<parameter type-id='type-id-6' name='device'/>
<return type-id='type-id-1'/>
</function-decl>
<type-decl name='unnamed-enum-underlying-type' is-anonymous='yes' size-in-bits='32' alignment-in-bits='32' id='type-id-7'/>
<enum-decl name='lzbe_flags' id='type-id-8'>
<underlying-type type-id='type-id-7'/>
<enumerator name='lzbe_add' value='0'/> <enumerator name='lzbe_add' value='0'/>
<enumerator name='lzbe_replace' value='1'/> <enumerator name='lzbe_replace' value='1'/>
</enum-decl> </enum-decl>
<pointer-type-def type-id='type-id-1' size-in-bits='64' id='type-id-6'/> <typedef-decl name='lzbe_flags_t' type-id='type-id-8' id='type-id-9'/>
<pointer-type-def type-id='type-id-6' size-in-bits='64' id='type-id-7'/> <function-decl name='lzbe_set_boot_device' mangled-name='lzbe_set_boot_device' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_set_boot_device'>
<qualified-type-def type-id='type-id-1' const='yes' id='type-id-8'/> <parameter type-id='type-id-4' name='pool'/>
<pointer-type-def type-id='type-id-8' size-in-bits='64' id='type-id-9'/> <parameter type-id='type-id-9' name='flag'/>
<function-decl name='lzbe_get_boot_device' mangled-name='lzbe_get_boot_device' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='114' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_get_boot_device'> <parameter type-id='type-id-4' name='device'/>
<parameter type-id='type-id-9' name='pool' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='114' column='1'/> <return type-id='type-id-1'/>
<parameter type-id='type-id-7' name='device' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='114' column='1'/>
<return type-id='type-id-2'/>
</function-decl> </function-decl>
<function-decl name='lzbe_set_boot_device' mangled-name='lzbe_set_boot_device' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='28' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_set_boot_device'> <type-decl name='void' id='type-id-10'/>
<parameter type-id='type-id-9' name='pool' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='28' column='1'/> <function-decl name='libzfs_init' mangled-name='libzfs_init' visibility='default' binding='global' size-in-bits='64'>
<parameter type-id='type-id-5' name='flag' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='28' column='1'/> <return type-id='type-id-10'/>
<parameter type-id='type-id-9' name='device' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_device.c' line='28' column='1'/> </function-decl>
<return type-id='type-id-2'/> <function-decl name='zpool_open' mangled-name='zpool_open' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='zpool_get_bootenv' mangled-name='zpool_get_bootenv' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='zpool_close' mangled-name='zpool_close' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='libzfs_fini' mangled-name='libzfs_fini' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_lookup_string' mangled-name='nvlist_lookup_string' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_free' mangled-name='nvlist_free' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='strdup' mangled-name='strdup' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='__stack_chk_fail' mangled-name='__stack_chk_fail' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='__asprintf_chk' mangled-name='__asprintf_chk' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='__fprintf_chk' mangled-name='__fprintf_chk' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='fnvlist_alloc' mangled-name='fnvlist_alloc' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='fnvlist_add_uint64' mangled-name='fnvlist_add_uint64' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_exists' mangled-name='nvlist_exists' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='zpool_set_bootenv' mangled-name='zpool_set_bootenv' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='fnvlist_free' mangled-name='fnvlist_free' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='fnvlist_add_string' mangled-name='fnvlist_add_string' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='free' mangled-name='free' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_lookup_uint64' mangled-name='nvlist_lookup_uint64' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='libzfs_error_description' mangled-name='libzfs_error_description' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='fnvlist_remove' mangled-name='fnvlist_remove' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl> </function-decl>
</abi-instr> </abi-instr>
<abi-instr version='1.0' address-size='64' path='lzbe_pair.c' comp-dir-path='/home/fedora/zfs/lib/libzfsbootenv' language='LANG_C99'> <abi-instr version='1.0' address-size='64' path='lzbe_pair.c' comp-dir-path='/home/runner/work/zfs/zfs/lib/libzfsbootenv' language='LANG_C99'>
<type-decl name='unsigned long int' size-in-bits='64' id='type-id-10'/> <pointer-type-def type-id='type-id-10' size-in-bits='64' id='type-id-11'/>
<type-decl name='void' id='type-id-11'/> <function-decl name='lzbe_remove_pair' mangled-name='lzbe_remove_pair' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_remove_pair'>
<typedef-decl name='size_t' type-id='type-id-10' filepath='/usr/lib/gcc/x86_64-redhat-linux/10/include/stddef.h' line='209' column='1' id='type-id-12'/> <parameter type-id='type-id-11' name='ptr'/>
<pointer-type-def type-id='type-id-11' size-in-bits='64' id='type-id-13'/> <parameter type-id='type-id-4' name='key'/>
<pointer-type-def type-id='type-id-13' size-in-bits='64' id='type-id-14'/> <return type-id='type-id-1'/>
<function-decl name='lzbe_remove_pair' mangled-name='lzbe_remove_pair' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='343' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_remove_pair'>
<parameter type-id='type-id-13' name='ptr' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='343' column='1'/>
<parameter type-id='type-id-9' name='key' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='343' column='1'/>
<return type-id='type-id-2'/>
</function-decl> </function-decl>
<function-decl name='lzbe_add_pair' mangled-name='lzbe_add_pair' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='182' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_add_pair'> <type-decl name='unsigned long int' size-in-bits='64' id='type-id-12'/>
<parameter type-id='type-id-13' name='ptr' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='182' column='1'/> <typedef-decl name='size_t' type-id='type-id-12' id='type-id-13'/>
<parameter type-id='type-id-9' name='key' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='182' column='1'/> <function-decl name='lzbe_add_pair' mangled-name='lzbe_add_pair' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_add_pair'>
<parameter type-id='type-id-9' name='type' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='182' column='1'/> <parameter type-id='type-id-11' name='ptr'/>
<parameter type-id='type-id-13' name='value' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='182' column='1'/> <parameter type-id='type-id-4' name='key'/>
<parameter type-id='type-id-12' name='size' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='183' column='1'/> <parameter type-id='type-id-4' name='type'/>
<return type-id='type-id-2'/> <parameter type-id='type-id-11' name='value'/>
<parameter type-id='type-id-13' name='size'/>
<return type-id='type-id-1'/>
</function-decl> </function-decl>
<function-decl name='lzbe_nvlist_free' mangled-name='lzbe_nvlist_free' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='131' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_free'> <function-decl name='lzbe_nvlist_free' mangled-name='lzbe_nvlist_free' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_free'>
<parameter type-id='type-id-13' name='ptr' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='131' column='1'/> <parameter type-id='type-id-11' name='ptr'/>
<return type-id='type-id-11'/> <return type-id='type-id-10'/>
</function-decl> </function-decl>
<function-decl name='lzbe_nvlist_set' mangled-name='lzbe_nvlist_set' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='74' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_set'> <function-decl name='lzbe_nvlist_set' mangled-name='lzbe_nvlist_set' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_set'>
<parameter type-id='type-id-9' name='pool' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='74' column='1'/> <parameter type-id='type-id-4' name='pool'/>
<parameter type-id='type-id-9' name='key' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='74' column='1'/> <parameter type-id='type-id-4' name='key'/>
<parameter type-id='type-id-13' name='ptr' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='74' column='1'/> <parameter type-id='type-id-11' name='ptr'/>
<return type-id='type-id-2'/> <return type-id='type-id-1'/>
</function-decl> </function-decl>
<function-decl name='lzbe_nvlist_get' mangled-name='lzbe_nvlist_get' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='27' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_get'> <pointer-type-def type-id='type-id-11' size-in-bits='64' id='type-id-14'/>
<parameter type-id='type-id-9' name='pool' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='27' column='1'/> <function-decl name='lzbe_nvlist_get' mangled-name='lzbe_nvlist_get' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_nvlist_get'>
<parameter type-id='type-id-9' name='key' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='27' column='1'/> <parameter type-id='type-id-4' name='pool'/>
<parameter type-id='type-id-14' name='ptr' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_pair.c' line='27' column='1'/> <parameter type-id='type-id-4' name='key'/>
<return type-id='type-id-2'/> <parameter type-id='type-id-14' name='ptr'/>
<return type-id='type-id-1'/>
</function-decl>
<function-decl name='nvlist_remove_all' mangled-name='nvlist_remove_all' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='strcmp' mangled-name='strcmp' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint8_array' mangled-name='nvlist_add_uint8_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_byte' mangled-name='nvlist_add_byte' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int16' mangled-name='nvlist_add_int16' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint16' mangled-name='nvlist_add_uint16' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int32' mangled-name='nvlist_add_int32' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint32' mangled-name='nvlist_add_uint32' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int64' mangled-name='nvlist_add_int64' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint64' mangled-name='nvlist_add_uint64' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_string' mangled-name='nvlist_add_string' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_byte_array' mangled-name='nvlist_add_byte_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int16_array' mangled-name='nvlist_add_int16_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint16_array' mangled-name='nvlist_add_uint16_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int32_array' mangled-name='nvlist_add_int32_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint32_array' mangled-name='nvlist_add_uint32_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int64_array' mangled-name='nvlist_add_int64_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint64_array' mangled-name='nvlist_add_uint64_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_string_array' mangled-name='nvlist_add_string_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_nvlist' mangled-name='nvlist_add_nvlist' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_nvlist_array' mangled-name='nvlist_add_nvlist_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_boolean_value' mangled-name='nvlist_add_boolean_value' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int8' mangled-name='nvlist_add_int8' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_uint8' mangled-name='nvlist_add_uint8' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_boolean_array' mangled-name='nvlist_add_boolean_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_add_int8_array' mangled-name='nvlist_add_int8_array' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_lookup_nvlist' mangled-name='nvlist_lookup_nvlist' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_dup' mangled-name='nvlist_dup' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_alloc' mangled-name='nvlist_alloc' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl> </function-decl>
</abi-instr> </abi-instr>
<abi-instr version='1.0' address-size='64' path='lzbe_util.c' comp-dir-path='/home/fedora/zfs/lib/libzfsbootenv' language='LANG_C99'> <abi-instr version='1.0' address-size='64' path='lzbe_util.c' comp-dir-path='/home/runner/work/zfs/zfs/lib/libzfsbootenv' language='LANG_C99'>
<class-decl name='_IO_FILE' size-in-bits='1728' is-struct='yes' visibility='default' id='type-id-15'>
<array-type-def dimensions='1' type-id='type-id-1' size-in-bits='8' id='type-id-15'>
<subrange length='1' type-id='type-id-10' id='type-id-16'/>
</array-type-def>
<array-type-def dimensions='1' type-id='type-id-1' size-in-bits='160' id='type-id-17'>
<subrange length='20' type-id='type-id-10' id='type-id-18'/>
</array-type-def>
<class-decl name='_IO_codecvt' is-struct='yes' visibility='default' is-declaration-only='yes' id='type-id-19'/>
<class-decl name='_IO_marker' is-struct='yes' visibility='default' is-declaration-only='yes' id='type-id-20'/>
<class-decl name='_IO_wide_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='type-id-21'/>
<type-decl name='long int' size-in-bits='64' id='type-id-22'/>
<type-decl name='signed char' size-in-bits='8' id='type-id-23'/>
<type-decl name='unsigned short int' size-in-bits='16' id='type-id-24'/>
<typedef-decl name='FILE' type-id='type-id-25' filepath='/usr/include/bits/types/FILE.h' line='7' column='1' id='type-id-26'/>
<class-decl name='_IO_FILE' size-in-bits='1728' is-struct='yes' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='49' column='1' id='type-id-25'>
<data-member access='public' layout-offset-in-bits='0'> <data-member access='public' layout-offset-in-bits='0'>
<var-decl name='_flags' type-id='type-id-2' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='51' column='1'/> <var-decl name='_flags' type-id='type-id-1' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='64'> <data-member access='public' layout-offset-in-bits='64'>
<var-decl name='_IO_read_ptr' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='54' column='1'/> <var-decl name='_IO_read_ptr' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='128'> <data-member access='public' layout-offset-in-bits='128'>
<var-decl name='_IO_read_end' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='55' column='1'/> <var-decl name='_IO_read_end' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='192'> <data-member access='public' layout-offset-in-bits='192'>
<var-decl name='_IO_read_base' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='56' column='1'/> <var-decl name='_IO_read_base' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='256'> <data-member access='public' layout-offset-in-bits='256'>
<var-decl name='_IO_write_base' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='57' column='1'/> <var-decl name='_IO_write_base' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='320'> <data-member access='public' layout-offset-in-bits='320'>
<var-decl name='_IO_write_ptr' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='58' column='1'/> <var-decl name='_IO_write_ptr' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='384'> <data-member access='public' layout-offset-in-bits='384'>
<var-decl name='_IO_write_end' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='59' column='1'/> <var-decl name='_IO_write_end' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='448'> <data-member access='public' layout-offset-in-bits='448'>
<var-decl name='_IO_buf_base' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='60' column='1'/> <var-decl name='_IO_buf_base' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='512'> <data-member access='public' layout-offset-in-bits='512'>
<var-decl name='_IO_buf_end' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='61' column='1'/> <var-decl name='_IO_buf_end' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='576'> <data-member access='public' layout-offset-in-bits='576'>
<var-decl name='_IO_save_base' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='64' column='1'/> <var-decl name='_IO_save_base' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='640'> <data-member access='public' layout-offset-in-bits='640'>
<var-decl name='_IO_backup_base' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='65' column='1'/> <var-decl name='_IO_backup_base' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='704'> <data-member access='public' layout-offset-in-bits='704'>
<var-decl name='_IO_save_end' type-id='type-id-6' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='66' column='1'/> <var-decl name='_IO_save_end' type-id='type-id-5' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='768'> <data-member access='public' layout-offset-in-bits='768'>
<var-decl name='_markers' type-id='type-id-27' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='68' column='1'/> <var-decl name='_markers' type-id='type-id-16' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='832'> <data-member access='public' layout-offset-in-bits='832'>
<var-decl name='_chain' type-id='type-id-28' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='70' column='1'/> <var-decl name='_chain' type-id='type-id-17' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='896'> <data-member access='public' layout-offset-in-bits='896'>
<var-decl name='_fileno' type-id='type-id-2' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='72' column='1'/> <var-decl name='_fileno' type-id='type-id-1' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='928'> <data-member access='public' layout-offset-in-bits='928'>
<var-decl name='_flags2' type-id='type-id-2' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='73' column='1'/> <var-decl name='_flags2' type-id='type-id-1' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='960'> <data-member access='public' layout-offset-in-bits='960'>
<var-decl name='_old_offset' type-id='type-id-29' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='74' column='1'/> <var-decl name='_old_offset' type-id='type-id-18' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1024'> <data-member access='public' layout-offset-in-bits='1024'>
<var-decl name='_cur_column' type-id='type-id-24' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='77' column='1'/> <var-decl name='_cur_column' type-id='type-id-19' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1040'> <data-member access='public' layout-offset-in-bits='1040'>
<var-decl name='_vtable_offset' type-id='type-id-23' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='78' column='1'/> <var-decl name='_vtable_offset' type-id='type-id-20' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1048'> <data-member access='public' layout-offset-in-bits='1048'>
<var-decl name='_shortbuf' type-id='type-id-15' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='79' column='1'/> <var-decl name='_shortbuf' type-id='type-id-21' visibility='default'/>
</data-member>
<data-member access='public' layout-offset-in-bits='1088'>
<var-decl name='_lock' type-id='type-id-30' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='81' column='1'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1152'> <data-member access='public' layout-offset-in-bits='1152'>
<var-decl name='_offset' type-id='type-id-31' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='89' column='1'/> <var-decl name='_offset' type-id='type-id-22' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1216'> <data-member access='public' layout-offset-in-bits='1216'>
<var-decl name='_codecvt' type-id='type-id-32' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='91' column='1'/> <var-decl name='__pad1' type-id='type-id-11' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1280'> <data-member access='public' layout-offset-in-bits='1280'>
<var-decl name='_wide_data' type-id='type-id-33' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='92' column='1'/> <var-decl name='__pad2' type-id='type-id-11' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1344'> <data-member access='public' layout-offset-in-bits='1344'>
<var-decl name='_freeres_list' type-id='type-id-28' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='93' column='1'/> <var-decl name='__pad3' type-id='type-id-11' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1408'> <data-member access='public' layout-offset-in-bits='1408'>
<var-decl name='_freeres_buf' type-id='type-id-13' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='94' column='1'/> <var-decl name='__pad4' type-id='type-id-11' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1472'> <data-member access='public' layout-offset-in-bits='1472'>
<var-decl name='__pad5' type-id='type-id-12' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='95' column='1'/> <var-decl name='__pad5' type-id='type-id-13' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1536'> <data-member access='public' layout-offset-in-bits='1536'>
<var-decl name='_mode' type-id='type-id-2' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='96' column='1'/> <var-decl name='_mode' type-id='type-id-1' visibility='default'/>
</data-member> </data-member>
<data-member access='public' layout-offset-in-bits='1568'> <data-member access='public' layout-offset-in-bits='1568'>
<var-decl name='_unused2' type-id='type-id-17' visibility='default' filepath='/usr/include/bits/types/struct_FILE.h' line='98' column='1'/> <var-decl name='_unused2' type-id='type-id-23' visibility='default'/>
</data-member> </data-member>
</class-decl> </class-decl>
<typedef-decl name='__off_t' type-id='type-id-22' filepath='/usr/include/bits/types.h' line='152' column='1' id='type-id-29'/> <class-decl name='_IO_marker' size-in-bits='192' is-struct='yes' visibility='default' id='type-id-24'>
<typedef-decl name='_IO_lock_t' type-id='type-id-11' filepath='/usr/include/bits/types/struct_FILE.h' line='43' column='1' id='type-id-34'/> <data-member access='public' layout-offset-in-bits='0'>
<typedef-decl name='__off64_t' type-id='type-id-22' filepath='/usr/include/bits/types.h' line='153' column='1' id='type-id-31'/> <var-decl name='_next' type-id='type-id-16' visibility='default'/>
<pointer-type-def type-id='type-id-26' size-in-bits='64' id='type-id-35'/> </data-member>
<pointer-type-def type-id='type-id-25' size-in-bits='64' id='type-id-28'/> <data-member access='public' layout-offset-in-bits='64'>
<pointer-type-def type-id='type-id-19' size-in-bits='64' id='type-id-32'/> <var-decl name='_sbuf' type-id='type-id-17' visibility='default'/>
<pointer-type-def type-id='type-id-34' size-in-bits='64' id='type-id-30'/> </data-member>
<pointer-type-def type-id='type-id-20' size-in-bits='64' id='type-id-27'/> <data-member access='public' layout-offset-in-bits='128'>
<pointer-type-def type-id='type-id-21' size-in-bits='64' id='type-id-33'/> <var-decl name='_pos' type-id='type-id-1' visibility='default'/>
<function-decl name='lzbe_bootenv_print' mangled-name='lzbe_bootenv_print' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_util.c' line='24' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_bootenv_print'> </data-member>
<parameter type-id='type-id-9' name='pool' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_util.c' line='24' column='1'/> </class-decl>
<parameter type-id='type-id-9' name='nvlist' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_util.c' line='24' column='1'/> <pointer-type-def type-id='type-id-24' size-in-bits='64' id='type-id-16'/>
<parameter type-id='type-id-35' name='of' filepath='/home/fedora/zfs/lib/libzfsbootenv/lzbe_util.c' line='24' column='1'/> <pointer-type-def type-id='type-id-15' size-in-bits='64' id='type-id-17'/>
<return type-id='type-id-2'/> <type-decl name='long int' size-in-bits='64' id='type-id-25'/>
<typedef-decl name='__off_t' type-id='type-id-25' id='type-id-18'/>
<type-decl name='unsigned short int' size-in-bits='16' id='type-id-19'/>
<type-decl name='signed char' size-in-bits='8' id='type-id-20'/>
<array-type-def dimensions='1' type-id='type-id-2' size-in-bits='8' id='type-id-21'>
<subrange length='1' type-id='type-id-12' id='type-id-26'/>
</array-type-def>
<typedef-decl name='__off64_t' type-id='type-id-25' id='type-id-22'/>
<array-type-def dimensions='1' type-id='type-id-2' size-in-bits='160' id='type-id-23'>
<subrange length='20' type-id='type-id-12' id='type-id-27'/>
</array-type-def>
<typedef-decl name='FILE' type-id='type-id-15' id='type-id-28'/>
<pointer-type-def type-id='type-id-28' size-in-bits='64' id='type-id-29'/>
<function-decl name='lzbe_bootenv_print' mangled-name='lzbe_bootenv_print' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='lzbe_bootenv_print'>
<parameter type-id='type-id-4' name='pool'/>
<parameter type-id='type-id-4' name='nvlist'/>
<parameter type-id='type-id-29' name='of'/>
<return type-id='type-id-1'/>
</function-decl>
<function-decl name='lzbe_nvlist_get' mangled-name='lzbe_nvlist_get' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl>
<function-decl name='nvlist_print' mangled-name='nvlist_print' visibility='default' binding='global' size-in-bits='64'>
<return type-id='type-id-10'/>
</function-decl> </function-decl>
</abi-instr> </abi-instr>
</abi-corpus> </abi-corpus>

View File

@ -634,7 +634,6 @@ vcmn_err(int ce, const char *fmt, va_list adx)
} }
} }
/*PRINTFLIKE2*/
void void
cmn_err(int ce, const char *fmt, ...) cmn_err(int ce, const char *fmt, ...)
{ {

View File

@ -69,8 +69,7 @@
#include "zutil_import.h" #include "zutil_import.h"
/*PRINTFLIKE2*/ static __attribute__((format(printf, 2, 3))) void
static void
zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...) zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -104,8 +103,7 @@ zutil_verror(libpc_handle_t *hdl, const char *error, const char *fmt,
} }
} }
/*PRINTFLIKE3*/ static __attribute__((format(printf, 3, 4))) int
static int
zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...) zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -1037,6 +1035,7 @@ zpool_read_label(int fd, nvlist_t **config, int *num_labels)
case EOPNOTSUPP: case EOPNOTSUPP:
case ENOSYS: case ENOSYS:
do_slow = B_TRUE; do_slow = B_TRUE;
/* FALLTHROUGH */
case 0: case 0:
default: default:
(void) aio_return(&aiocbs[l]); (void) aio_return(&aiocbs[l]);
@ -1237,7 +1236,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
if (error == ENOENT) if (error == ENOENT)
return (0); return (0);
zutil_error_aux(hdl, strerror(error)); zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext( (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir); TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
return (error); return (error);
@ -1246,7 +1245,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
dirp = opendir(path); dirp = opendir(path);
if (dirp == NULL) { if (dirp == NULL) {
error = errno; error = errno;
zutil_error_aux(hdl, strerror(error)); zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, (void) zutil_error_fmt(hdl, EZFS_BADPATH,
dgettext(TEXT_DOMAIN, "cannot open '%s'"), path); dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
return (error); return (error);
@ -1308,7 +1307,7 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
goto out; goto out;
} }
zutil_error_aux(hdl, strerror(error)); zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext( (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir); TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
goto out; goto out;
@ -1346,7 +1345,7 @@ zpool_find_import_scan(libpc_handle_t *hdl, pthread_mutex_t *lock,
if (error == ENOENT) if (error == ENOENT)
continue; continue;
zutil_error_aux(hdl, strerror(error)); zutil_error_aux(hdl, "%s", strerror(error));
(void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext( (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]); TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
goto error; goto error;

View File

@ -203,8 +203,8 @@ create subcommand Must also have the \fBmount\fR ability. Must also have the \fB
destroy subcommand Must also have the \fBmount\fR ability destroy subcommand Must also have the \fBmount\fR ability
diff subcommand Allows lookup of paths within a dataset given an object number, and the ability to create snapshots necessary to \fBzfs diff\fR. diff subcommand Allows lookup of paths within a dataset given an object number, and the ability to create snapshots necessary to \fBzfs diff\fR.
hold subcommand Allows adding a user hold to a snapshot hold subcommand Allows adding a user hold to a snapshot
load subcommand Allows loading and unloading of encryption key (see \fBzfs load-key\fR and \fBzfs unload-key\fR). load-key subcommand Allows loading and unloading of encryption key (see \fBzfs load-key\fR and \fBzfs unload-key\fR).
change subcommand Allows changing an encryption key via \fBzfs change-key\fR. change-key subcommand Allows changing an encryption key via \fBzfs change-key\fR.
mount subcommand Allows mounting/umounting ZFS datasets mount subcommand Allows mounting/umounting ZFS datasets
promote subcommand Must also have the \fBmount\fR and \fBpromote\fR ability in the origin file system promote subcommand Must also have the \fBmount\fR and \fBpromote\fR ability in the origin file system
receive subcommand Must also have the \fBmount\fR and \fBcreate\fR ability receive subcommand Must also have the \fBmount\fR and \fBcreate\fR ability
@ -216,45 +216,69 @@ share subcommand Allows sharing file systems over NFS or SMB protocols
snapshot subcommand Must also have the \fBmount\fR ability snapshot subcommand Must also have the \fBmount\fR ability
groupquota other Allows accessing any \fBgroupquota@\fI...\fR property groupquota other Allows accessing any \fBgroupquota@\fI...\fR property
groupobjquota other Allows accessing any \fBgroupobjquota@\fI...\fR property
groupused other Allows reading any \fBgroupused@\fI...\fR property groupused other Allows reading any \fBgroupused@\fI...\fR property
groupobjused other Allows reading any \fBgroupobjused@\fI...\fR property
userprop other Allows changing any user property userprop other Allows changing any user property
userquota other Allows accessing any \fBuserquota@\fI...\fR property userquota other Allows accessing any \fBuserquota@\fI...\fR property
userobjquota other Allows accessing any \fBuserobjquota@\fI...\fR property
userused other Allows reading any \fBuserused@\fI...\fR property userused other Allows reading any \fBuserused@\fI...\fR property
userobjused other Allows reading any \fBuserobjused@\fI...\fR property
projectobjquota other Allows accessing any \fBprojectobjquota@\fI...\fR property projectobjquota other Allows accessing any \fBprojectobjquota@\fI...\fR property
projectquota other Allows accessing any \fBprojectquota@\fI...\fR property projectquota other Allows accessing any \fBprojectquota@\fI...\fR property
projectobjused other Allows reading any \fBprojectobjused@\fI...\fR property projectobjused other Allows reading any \fBprojectobjused@\fI...\fR property
projectused other Allows reading any \fBprojectused@\fI...\fR property projectused other Allows reading any \fBprojectused@\fI...\fR property
aclinherit property aclinherit property
aclmode property
acltype property acltype property
atime property atime property
canmount property canmount property
casesensitivity property casesensitivity property
checksum property checksum property
compression property compression property
context property
copies property copies property
dedup property
defcontext property
devices property devices property
dnodesize property
encryption property
exec property exec property
filesystem_limit property filesystem_limit property
fscontext property
keyformat property
keylocation property
logbias property
mlslabel property
mountpoint property mountpoint property
nbmand property nbmand property
normalization property normalization property
overlay property
pbkdf2iters property
primarycache property primarycache property
quota property quota property
readonly property readonly property
recordsize property recordsize property
redundant_metadata property
refquota property refquota property
refreservation property refreservation property
relatime property
reservation property reservation property
rootcontext property
secondarycache property secondarycache property
setuid property setuid property
sharenfs property sharenfs property
sharesmb property sharesmb property
snapdev property
snapdir property snapdir property
snapshot_limit property snapshot_limit property
special_small_blocks property
sync property
utf8only property utf8only property
version property version property
volblocksize property volblocksize property
volmode property
volsize property volsize property
vscan property vscan property
xattr property xattr property

View File

@ -22,11 +22,11 @@
.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved. .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
.\" Copyright (c) 2017 Datto Inc. .\" Copyright (c) 2017 Datto Inc.
.\" Copyright (c) 2018 George Melikov. All Rights Reserved. .\" Copyright (c) 2018, 2021 George Melikov. All Rights Reserved.
.\" Copyright 2017 Nexenta Systems, Inc. .\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved. .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\" .\"
.Dd May 27, 2021 .Dd July 25, 2021
.Dt ZPOOL-SCRUB 8 .Dt ZPOOL-SCRUB 8
.Os .Os
. .
@ -64,6 +64,11 @@ faults or disk failure.
.Pp .Pp
Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
one at a time. one at a time.
.Pp
A scrub is split into two parts: metadata scanning and block scrubbing.
The metadata scanning sorts blocks into large sequential ranges which can then
be read much more efficiently from disk when issuing the scrub I/O.
.Pp
If a scrub is paused, the If a scrub is paused, the
.Nm zpool Cm scrub .Nm zpool Cm scrub
resumes it. resumes it.
@ -91,6 +96,26 @@ again.
.It Fl w .It Fl w
Wait until scrub has completed before returning. Wait until scrub has completed before returning.
.El .El
.Sh EXAMPLES
.Bl -tag -width "Exam"
.It Sy Example 1 : Status of pool with ongoing scrub:
Output:
.Bd -literal -compact -offset Ds
.No # Nm zpool Cm status
...
scan: scrub in progress since Sun Jul 25 16:07:49 2021
403M scanned at 100M/s, 68.4M issued at 10.0M/s, 405M total
0B repaired, 16.91% done, 00:00:04 to go
...
.Ed
Where:
.Bl -dash -offset indent
.It
Metadata which references 403M of file data has been
scanned at 100M/s, and 68.4M of that file data has been
scrubbed sequentially at 10.0M/s.
.El
.El
. .
.Sh SEE ALSO .Sh SEE ALSO
.Xr zpool-iostat 8 , .Xr zpool-iostat 8 ,

View File

@ -26,7 +26,6 @@
#include <sys/skein.h> #include <sys/skein.h>
#include <sys/strings.h> #include <sys/strings.h>
#include <sys/note.h>
#include "skein_impl.h" #include "skein_impl.h"
#include "skein_port.h" #include "skein_port.h"
@ -139,7 +138,6 @@
#define Skein_Set_Tweak(ctxPtr, TWK_NUM, tVal) \ #define Skein_Set_Tweak(ctxPtr, TWK_NUM, tVal) \
do { \ do { \
(ctxPtr)->h.T[TWK_NUM] = (tVal); \ (ctxPtr)->h.T[TWK_NUM] = (tVal); \
_NOTE(CONSTCOND) \
} while (0) } while (0)
#define Skein_Get_T0(ctxPtr) Skein_Get_Tweak(ctxPtr, 0) #define Skein_Get_T0(ctxPtr) Skein_Get_Tweak(ctxPtr, 0)
@ -152,7 +150,6 @@
do { \ do { \
Skein_Set_T0(ctxPtr, (T0)); \ Skein_Set_T0(ctxPtr, (T0)); \
Skein_Set_T1(ctxPtr, (T1)); \ Skein_Set_T1(ctxPtr, (T1)); \
_NOTE(CONSTCOND) \
} while (0) } while (0)
#define Skein_Set_Type(ctxPtr, BLK_TYPE) \ #define Skein_Set_Type(ctxPtr, BLK_TYPE) \
@ -166,24 +163,20 @@
Skein_Set_T0_T1(ctxPtr, 0, SKEIN_T1_FLAG_FIRST | \ Skein_Set_T0_T1(ctxPtr, 0, SKEIN_T1_FLAG_FIRST | \
SKEIN_T1_BLK_TYPE_ ## BLK_TYPE); \ SKEIN_T1_BLK_TYPE_ ## BLK_TYPE); \
(ctxPtr)->h.bCnt = 0; \ (ctxPtr)->h.bCnt = 0; \
_NOTE(CONSTCOND) \
} while (0) } while (0)
#define Skein_Clear_First_Flag(hdr) \ #define Skein_Clear_First_Flag(hdr) \
do { \ do { \
(hdr).T[1] &= ~SKEIN_T1_FLAG_FIRST; \ (hdr).T[1] &= ~SKEIN_T1_FLAG_FIRST; \
_NOTE(CONSTCOND) \
} while (0) } while (0)
#define Skein_Set_Bit_Pad_Flag(hdr) \ #define Skein_Set_Bit_Pad_Flag(hdr) \
do { \ do { \
(hdr).T[1] |= SKEIN_T1_FLAG_BIT_PAD; \ (hdr).T[1] |= SKEIN_T1_FLAG_BIT_PAD; \
_NOTE(CONSTCOND) \
} while (0) } while (0)
#define Skein_Set_Tree_Level(hdr, height) \ #define Skein_Set_Tree_Level(hdr, height) \
do { \ do { \
(hdr).T[1] |= SKEIN_T1_TREE_LEVEL(height); \ (hdr).T[1] |= SKEIN_T1_TREE_LEVEL(height); \
_NOTE(CONSTCOND) \
} while (0) } while (0)
/* /*
@ -212,7 +205,6 @@
do { \ do { \
if (!(x)) \ if (!(x)) \
return (retCode); \ return (retCode); \
_NOTE(CONSTCOND) \
} while (0) } while (0)
/* internal error */ /* internal error */
#define Skein_assert(x) ASSERT(x) #define Skein_assert(x) ASSERT(x)

View File

@ -377,7 +377,7 @@ kcf_provider_zero_refcnt(kcf_provider_desc_t *desc)
mutex_exit(&desc->pd_lock); mutex_exit(&desc->pd_lock);
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
case CRYPTO_HW_PROVIDER: case CRYPTO_HW_PROVIDER:
case CRYPTO_LOGICAL_PROVIDER: case CRYPTO_LOGICAL_PROVIDER:

View File

@ -976,7 +976,7 @@ aes_encrypt_atomic(crypto_provider_handle_t provider,
case AES_GMAC_MECH_INFO_TYPE: case AES_GMAC_MECH_INFO_TYPE:
if (plaintext->cd_length != 0) if (plaintext->cd_length != 0)
return (CRYPTO_ARGUMENTS_BAD); return (CRYPTO_ARGUMENTS_BAD);
/* FALLTHRU */ /* FALLTHROUGH */
case AES_GCM_MECH_INFO_TYPE: case AES_GCM_MECH_INFO_TYPE:
length_needed = plaintext->cd_length + aes_ctx.ac_tag_len; length_needed = plaintext->cd_length + aes_ctx.ac_tag_len;
break; break;

View File

@ -179,7 +179,6 @@ typedef struct skein_ctx {
(void) Skein1024_ ## _op(&sc->sc_1024, __VA_ARGS__);\ (void) Skein1024_ ## _op(&sc->sc_1024, __VA_ARGS__);\
break; \ break; \
} \ } \
_NOTE(CONSTCOND) \
} while (0) } while (0)
static int static int

View File

@ -132,7 +132,7 @@ abd_scatter_chunkcnt(abd_t *abd)
boolean_t boolean_t
abd_size_alloc_linear(size_t size) abd_size_alloc_linear(size_t size)
{ {
return (size < zfs_abd_scatter_min_size ? B_TRUE : B_FALSE); return (!zfs_abd_scatter_enabled || size < zfs_abd_scatter_min_size);
} }
void void

View File

@ -1100,6 +1100,10 @@ vdev_geom_check_unmapped(zio_t *zio, struct g_consumer *cp)
{ {
struct vdev_geom_check_unmapped_cb_state s; struct vdev_geom_check_unmapped_cb_state s;
/* If unmapped I/O is administratively disabled, respect that. */
if (!unmapped_buf_allowed)
return (0);
/* If the buffer is already linear, then nothing to do here. */ /* If the buffer is already linear, then nothing to do here. */
if (abd_is_linear(zio->io_abd)) if (abd_is_linear(zio->io_abd))
return (0); return (0);

View File

@ -1084,7 +1084,7 @@ zfsctl_snapdir_readdir(struct vop_readdir_args *ap)
} }
zfs_uio_setoffset(&uio, cookie + dots_offset); zfs_uio_setoffset(&uio, cookie + dots_offset);
} }
/* NOTREACHED */ __builtin_unreachable();
} }
static int static int

View File

@ -1060,7 +1060,6 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
if (should_bswap) if (should_bswap)
intval = BSWAP_64(intval); intval = BSWAP_64(intval);
intval &= OBJSET_CRYPT_PORTABLE_FLAGS_MASK; intval &= OBJSET_CRYPT_PORTABLE_FLAGS_MASK;
/* CONSTCOND */
if (!ZFS_HOST_BYTEORDER) if (!ZFS_HOST_BYTEORDER)
intval = BSWAP_64(intval); intval = BSWAP_64(intval);
@ -1100,7 +1099,6 @@ zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen,
if (should_bswap) if (should_bswap)
intval = BSWAP_64(intval); intval = BSWAP_64(intval);
intval &= ~OBJSET_CRYPT_PORTABLE_FLAGS_MASK; intval &= ~OBJSET_CRYPT_PORTABLE_FLAGS_MASK;
/* CONSTCOND */
if (!ZFS_HOST_BYTEORDER) if (!ZFS_HOST_BYTEORDER)
intval = BSWAP_64(intval); intval = BSWAP_64(intval);

View File

@ -632,7 +632,7 @@ abd_alloc_zero_scatter(void)
boolean_t boolean_t
abd_size_alloc_linear(size_t size) abd_size_alloc_linear(size_t size)
{ {
return (size < zfs_abd_scatter_min_size ? B_TRUE : B_FALSE); return (!zfs_abd_scatter_enabled || size < zfs_abd_scatter_min_size);
} }
void void

View File

@ -419,30 +419,11 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len,
goto fail; goto fail;
} }
flat_buf_dst = (CpaFlatBuffer *)(buf_list_dst + 1); /* get adler32 checksum and append footer */
/* move to the last page */ *(Cpa32U*)(dst + hdr_sz + compressed_sz) =
flat_buf_dst += (compressed_sz + hdr_sz) >> PAGE_SHIFT; BSWAP_32(dc_results.checksum);
/* no space for gzip footer in the last page */ *c_len = hdr_sz + compressed_sz + ZLIB_FOOT_SZ;
if (((compressed_sz + hdr_sz) % PAGE_SIZE)
+ ZLIB_FOOT_SZ > PAGE_SIZE) {
status = CPA_STATUS_INCOMPRESSIBLE;
goto fail;
}
/* jump to the end of the buffer and append footer */
flat_buf_dst->pData =
(char *)((unsigned long)flat_buf_dst->pData & PAGE_MASK)
+ ((compressed_sz + hdr_sz) % PAGE_SIZE);
flat_buf_dst->dataLenInBytes = ZLIB_FOOT_SZ;
dc_results.produced = 0;
status = cpaDcGenerateFooter(session_handle,
flat_buf_dst, &dc_results);
if (status != CPA_STATUS_SUCCESS)
goto fail;
*c_len = compressed_sz + dc_results.produced + hdr_sz;
QAT_STAT_INCR(comp_total_out_bytes, *c_len); QAT_STAT_INCR(comp_total_out_bytes, *c_len);
} else { } else {
ASSERT3U(dir, ==, QAT_DECOMPRESS); ASSERT3U(dir, ==, QAT_DECOMPRESS);

View File

@ -546,7 +546,9 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio,
if (io_offset + io_size > bdev->bd_inode->i_size) { if (io_offset + io_size > bdev->bd_inode->i_size) {
vdev_dbgmsg(zio->io_vd, vdev_dbgmsg(zio->io_vd,
"Illegal access %llu size %llu, device size %llu", "Illegal access %llu size %llu, device size %llu",
io_offset, io_size, i_size_read(bdev->bd_inode)); (u_longlong_t)io_offset,
(u_longlong_t)io_size,
(u_longlong_t)i_size_read(bdev->bd_inode));
return (SET_ERROR(EIO)); return (SET_ERROR(EIO));
} }

View File

@ -33,6 +33,9 @@
#include <sys/zfs_vfsops.h> #include <sys/zfs_vfsops.h>
#include <sys/zfs_vnops.h> #include <sys/zfs_vnops.h>
#include <sys/zfs_project.h> #include <sys/zfs_project.h>
#ifdef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS
#include <linux/pagemap.h>
#endif
/* /*
* When using fallocate(2) to preallocate space, inflate the requested * When using fallocate(2) to preallocate space, inflate the requested
@ -1018,6 +1021,9 @@ const struct address_space_operations zpl_address_space_operations = {
.writepage = zpl_writepage, .writepage = zpl_writepage,
.writepages = zpl_writepages, .writepages = zpl_writepages,
.direct_IO = zpl_direct_IO, .direct_IO = zpl_direct_IO,
#ifdef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS
.set_page_dirty = __set_page_dirty_nobuffers,
#endif
}; };
const struct file_operations zpl_file_operations = { const struct file_operations zpl_file_operations = {

View File

@ -795,13 +795,40 @@ zvol_alloc(dev_t dev, const char *name)
mutex_init(&zv->zv_state_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&zv->zv_state_lock, NULL, MUTEX_DEFAULT, NULL);
#ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS #ifdef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS
zso->zvo_queue = blk_alloc_queue(NUMA_NO_NODE); #ifdef HAVE_BLK_ALLOC_DISK
zso->zvo_disk = blk_alloc_disk(NUMA_NO_NODE);
if (zso->zvo_disk == NULL)
goto out_kmem;
zso->zvo_disk->minors = ZVOL_MINORS;
zso->zvo_queue = zso->zvo_disk->queue;
#else #else
zso->zvo_queue = blk_generic_alloc_queue(zvol_request, NUMA_NO_NODE); zso->zvo_queue = blk_alloc_queue(NUMA_NO_NODE);
#endif
if (zso->zvo_queue == NULL) if (zso->zvo_queue == NULL)
goto out_kmem; goto out_kmem;
zso->zvo_disk = alloc_disk(ZVOL_MINORS);
if (zso->zvo_disk == NULL) {
blk_cleanup_queue(zso->zvo_queue);
goto out_kmem;
}
zso->zvo_disk->queue = zso->zvo_queue;
#endif /* HAVE_BLK_ALLOC_DISK */
#else
zso->zvo_queue = blk_generic_alloc_queue(zvol_request, NUMA_NO_NODE);
if (zso->zvo_queue == NULL)
goto out_kmem;
zso->zvo_disk = alloc_disk(ZVOL_MINORS);
if (zso->zvo_disk == NULL) {
blk_cleanup_queue(zso->zvo_queue);
goto out_kmem;
}
zso->zvo_disk->queue = zso->zvo_queue;
#endif /* HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */
blk_queue_set_write_cache(zso->zvo_queue, B_TRUE, B_TRUE); blk_queue_set_write_cache(zso->zvo_queue, B_TRUE, B_TRUE);
/* Limit read-ahead to a single page to prevent over-prefetching. */ /* Limit read-ahead to a single page to prevent over-prefetching. */
@ -810,9 +837,8 @@ zvol_alloc(dev_t dev, const char *name)
/* Disable write merging in favor of the ZIO pipeline. */ /* Disable write merging in favor of the ZIO pipeline. */
blk_queue_flag_set(QUEUE_FLAG_NOMERGES, zso->zvo_queue); blk_queue_flag_set(QUEUE_FLAG_NOMERGES, zso->zvo_queue);
zso->zvo_disk = alloc_disk(ZVOL_MINORS); /* Enable /proc/diskstats */
if (zso->zvo_disk == NULL) blk_queue_flag_set(QUEUE_FLAG_IO_STAT, zso->zvo_queue);
goto out_queue;
zso->zvo_queue->queuedata = zv; zso->zvo_queue->queuedata = zv;
zso->zvo_dev = dev; zso->zvo_dev = dev;
@ -844,14 +870,11 @@ zvol_alloc(dev_t dev, const char *name)
zso->zvo_disk->first_minor = (dev & MINORMASK); zso->zvo_disk->first_minor = (dev & MINORMASK);
zso->zvo_disk->fops = &zvol_ops; zso->zvo_disk->fops = &zvol_ops;
zso->zvo_disk->private_data = zv; zso->zvo_disk->private_data = zv;
zso->zvo_disk->queue = zso->zvo_queue;
snprintf(zso->zvo_disk->disk_name, DISK_NAME_LEN, "%s%d", snprintf(zso->zvo_disk->disk_name, DISK_NAME_LEN, "%s%d",
ZVOL_DEV_NAME, (dev & MINORMASK)); ZVOL_DEV_NAME, (dev & MINORMASK));
return (zv); return (zv);
out_queue:
blk_cleanup_queue(zso->zvo_queue);
out_kmem: out_kmem:
kmem_free(zso, sizeof (struct zvol_state_os)); kmem_free(zso, sizeof (struct zvol_state_os));
kmem_free(zv, sizeof (zvol_state_t)); kmem_free(zv, sizeof (zvol_state_t));
@ -882,8 +905,13 @@ zvol_free(zvol_state_t *zv)
zfs_rangelock_fini(&zv->zv_rangelock); zfs_rangelock_fini(&zv->zv_rangelock);
del_gendisk(zv->zv_zso->zvo_disk); del_gendisk(zv->zv_zso->zvo_disk);
#if defined(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS) && \
defined(HAVE_BLK_ALLOC_DISK)
blk_cleanup_disk(zv->zv_zso->zvo_disk);
#else
blk_cleanup_queue(zv->zv_zso->zvo_queue); blk_cleanup_queue(zv->zv_zso->zvo_queue);
put_disk(zv->zv_zso->zvo_disk); put_disk(zv->zv_zso->zvo_disk);
#endif
ida_simple_remove(&zvol_ida, ida_simple_remove(&zvol_ida,
MINOR(zv->zv_zso->zvo_dev) >> ZVOL_MINOR_BITS); MINOR(zv->zv_zso->zvo_dev) >> ZVOL_MINOR_BITS);

View File

@ -181,7 +181,7 @@ abd_free_struct(abd_t *abd)
abd_t * abd_t *
abd_alloc(size_t size, boolean_t is_metadata) abd_alloc(size_t size, boolean_t is_metadata)
{ {
if (!zfs_abd_scatter_enabled || abd_size_alloc_linear(size)) if (abd_size_alloc_linear(size))
return (abd_alloc_linear(size, is_metadata)); return (abd_alloc_linear(size, is_metadata));
VERIFY3U(size, <=, SPA_MAXBLOCKSIZE); VERIFY3U(size, <=, SPA_MAXBLOCKSIZE);

View File

@ -644,7 +644,6 @@ arc_sums_t arc_sums;
x = x - x / ARCSTAT_F_AVG_FACTOR + \ x = x - x / ARCSTAT_F_AVG_FACTOR + \
(value) / ARCSTAT_F_AVG_FACTOR; \ (value) / ARCSTAT_F_AVG_FACTOR; \
ARCSTAT(stat) = x; \ ARCSTAT(stat) = x; \
_NOTE(CONSTCOND) \
} while (0) } while (0)
kstat_t *arc_ksp; kstat_t *arc_ksp;
@ -6873,7 +6872,8 @@ arc_write_ready(zio_t *zio)
ASSERT(ARC_BUF_COMPRESSED(buf)); ASSERT(ARC_BUF_COMPRESSED(buf));
arc_hdr_alloc_abd(hdr, ARC_HDR_DO_ADAPT|ARC_HDR_ALLOC_RDATA); arc_hdr_alloc_abd(hdr, ARC_HDR_DO_ADAPT|ARC_HDR_ALLOC_RDATA);
abd_copy(hdr->b_crypt_hdr.b_rabd, zio->io_abd, psize); abd_copy(hdr->b_crypt_hdr.b_rabd, zio->io_abd, psize);
} else if (zfs_abd_scatter_enabled || !arc_can_share(hdr, buf)) { } else if (!abd_size_alloc_linear(arc_buf_size(buf)) ||
!arc_can_share(hdr, buf)) {
/* /*
* Ideally, we would always copy the io_abd into b_pabd, but the * Ideally, we would always copy the io_abd into b_pabd, but the
* user may have disabled compressed ARC, thus we must check the * user may have disabled compressed ARC, thus we must check the
@ -7470,7 +7470,7 @@ arc_state_multilist_index_func(multilist_t *ml, void *obj)
if ((do_warn) && (tuning) && ((tuning) != (value))) { \ if ((do_warn) && (tuning) && ((tuning) != (value))) { \
cmn_err(CE_WARN, \ cmn_err(CE_WARN, \
"ignoring tunable %s (using %llu instead)", \ "ignoring tunable %s (using %llu instead)", \
(#tuning), (value)); \ (#tuning), (u_longlong_t)(value)); \
} \ } \
} while (0) } while (0)
@ -8355,8 +8355,8 @@ l2arc_write_size(l2arc_dev_t *dev)
"plus the overhead of log blocks (persistent L2ARC, " "plus the overhead of log blocks (persistent L2ARC, "
"%llu bytes) exceeds the size of the cache device " "%llu bytes) exceeds the size of the cache device "
"(guid %llu), resetting them to the default (%d)", "(guid %llu), resetting them to the default (%d)",
l2arc_log_blk_overhead(size, dev), (u_longlong_t)l2arc_log_blk_overhead(size, dev),
dev->l2ad_vdev->vdev_guid, L2ARC_WRITE_SIZE); (u_longlong_t)dev->l2ad_vdev->vdev_guid, L2ARC_WRITE_SIZE);
size = l2arc_write_max = l2arc_write_boost = L2ARC_WRITE_SIZE; size = l2arc_write_max = l2arc_write_boost = L2ARC_WRITE_SIZE;
if (arc_warm == B_FALSE) if (arc_warm == B_FALSE)
@ -9750,85 +9750,12 @@ l2arc_vdev_get(vdev_t *vd)
return (dev); return (dev);
} }
/* static void
* Add a vdev for use by the L2ARC. By this point the spa has already l2arc_rebuild_dev(l2arc_dev_t *dev, boolean_t reopen)
* validated the vdev and opened it.
*/
void
l2arc_add_vdev(spa_t *spa, vdev_t *vd)
{ {
l2arc_dev_t *adddev; l2arc_dev_hdr_phys_t *l2dhdr = dev->l2ad_dev_hdr;
uint64_t l2dhdr_asize; uint64_t l2dhdr_asize = dev->l2ad_dev_hdr_asize;
spa_t *spa = dev->l2ad_spa;
ASSERT(!l2arc_vdev_present(vd));
/*
* Create a new l2arc device entry.
*/
adddev = vmem_zalloc(sizeof (l2arc_dev_t), KM_SLEEP);
adddev->l2ad_spa = spa;
adddev->l2ad_vdev = vd;
/* leave extra size for an l2arc device header */
l2dhdr_asize = adddev->l2ad_dev_hdr_asize =
MAX(sizeof (*adddev->l2ad_dev_hdr), 1 << vd->vdev_ashift);
adddev->l2ad_start = VDEV_LABEL_START_SIZE + l2dhdr_asize;
adddev->l2ad_end = VDEV_LABEL_START_SIZE + vdev_get_min_asize(vd);
ASSERT3U(adddev->l2ad_start, <, adddev->l2ad_end);
adddev->l2ad_hand = adddev->l2ad_start;
adddev->l2ad_evict = adddev->l2ad_start;
adddev->l2ad_first = B_TRUE;
adddev->l2ad_writing = B_FALSE;
adddev->l2ad_trim_all = B_FALSE;
list_link_init(&adddev->l2ad_node);
adddev->l2ad_dev_hdr = kmem_zalloc(l2dhdr_asize, KM_SLEEP);
mutex_init(&adddev->l2ad_mtx, NULL, MUTEX_DEFAULT, NULL);
/*
* This is a list of all ARC buffers that are still valid on the
* device.
*/
list_create(&adddev->l2ad_buflist, sizeof (arc_buf_hdr_t),
offsetof(arc_buf_hdr_t, b_l2hdr.b_l2node));
/*
* This is a list of pointers to log blocks that are still present
* on the device.
*/
list_create(&adddev->l2ad_lbptr_list, sizeof (l2arc_lb_ptr_buf_t),
offsetof(l2arc_lb_ptr_buf_t, node));
vdev_space_update(vd, 0, 0, adddev->l2ad_end - adddev->l2ad_hand);
zfs_refcount_create(&adddev->l2ad_alloc);
zfs_refcount_create(&adddev->l2ad_lb_asize);
zfs_refcount_create(&adddev->l2ad_lb_count);
/*
* Add device to global list
*/
mutex_enter(&l2arc_dev_mtx);
list_insert_head(l2arc_dev_list, adddev);
atomic_inc_64(&l2arc_ndev);
mutex_exit(&l2arc_dev_mtx);
/*
* Decide if vdev is eligible for L2ARC rebuild
*/
l2arc_rebuild_vdev(adddev->l2ad_vdev, B_FALSE);
}
void
l2arc_rebuild_vdev(vdev_t *vd, boolean_t reopen)
{
l2arc_dev_t *dev = NULL;
l2arc_dev_hdr_phys_t *l2dhdr;
uint64_t l2dhdr_asize;
spa_t *spa;
dev = l2arc_vdev_get(vd);
ASSERT3P(dev, !=, NULL);
spa = dev->l2ad_spa;
l2dhdr = dev->l2ad_dev_hdr;
l2dhdr_asize = dev->l2ad_dev_hdr_asize;
/* /*
* The L2ARC has to hold at least the payload of one log block for * The L2ARC has to hold at least the payload of one log block for
@ -9897,6 +9824,106 @@ l2arc_rebuild_vdev(vdev_t *vd, boolean_t reopen)
} }
} }
/*
* Add a vdev for use by the L2ARC. By this point the spa has already
* validated the vdev and opened it.
*/
void
l2arc_add_vdev(spa_t *spa, vdev_t *vd)
{
l2arc_dev_t *adddev;
uint64_t l2dhdr_asize;
ASSERT(!l2arc_vdev_present(vd));
/*
* Create a new l2arc device entry.
*/
adddev = vmem_zalloc(sizeof (l2arc_dev_t), KM_SLEEP);
adddev->l2ad_spa = spa;
adddev->l2ad_vdev = vd;
/* leave extra size for an l2arc device header */
l2dhdr_asize = adddev->l2ad_dev_hdr_asize =
MAX(sizeof (*adddev->l2ad_dev_hdr), 1 << vd->vdev_ashift);
adddev->l2ad_start = VDEV_LABEL_START_SIZE + l2dhdr_asize;
adddev->l2ad_end = VDEV_LABEL_START_SIZE + vdev_get_min_asize(vd);
ASSERT3U(adddev->l2ad_start, <, adddev->l2ad_end);
adddev->l2ad_hand = adddev->l2ad_start;
adddev->l2ad_evict = adddev->l2ad_start;
adddev->l2ad_first = B_TRUE;
adddev->l2ad_writing = B_FALSE;
adddev->l2ad_trim_all = B_FALSE;
list_link_init(&adddev->l2ad_node);
adddev->l2ad_dev_hdr = kmem_zalloc(l2dhdr_asize, KM_SLEEP);
mutex_init(&adddev->l2ad_mtx, NULL, MUTEX_DEFAULT, NULL);
/*
* This is a list of all ARC buffers that are still valid on the
* device.
*/
list_create(&adddev->l2ad_buflist, sizeof (arc_buf_hdr_t),
offsetof(arc_buf_hdr_t, b_l2hdr.b_l2node));
/*
* This is a list of pointers to log blocks that are still present
* on the device.
*/
list_create(&adddev->l2ad_lbptr_list, sizeof (l2arc_lb_ptr_buf_t),
offsetof(l2arc_lb_ptr_buf_t, node));
vdev_space_update(vd, 0, 0, adddev->l2ad_end - adddev->l2ad_hand);
zfs_refcount_create(&adddev->l2ad_alloc);
zfs_refcount_create(&adddev->l2ad_lb_asize);
zfs_refcount_create(&adddev->l2ad_lb_count);
/*
* Decide if dev is eligible for L2ARC rebuild or whole device
* trimming. This has to happen before the device is added in the
* cache device list and l2arc_dev_mtx is released. Otherwise
* l2arc_feed_thread() might already start writing on the
* device.
*/
l2arc_rebuild_dev(adddev, B_FALSE);
/*
* Add device to global list
*/
mutex_enter(&l2arc_dev_mtx);
list_insert_head(l2arc_dev_list, adddev);
atomic_inc_64(&l2arc_ndev);
mutex_exit(&l2arc_dev_mtx);
}
/*
* Decide if a vdev is eligible for L2ARC rebuild, called from vdev_reopen()
* in case of onlining a cache device.
*/
void
l2arc_rebuild_vdev(vdev_t *vd, boolean_t reopen)
{
l2arc_dev_t *dev = NULL;
dev = l2arc_vdev_get(vd);
ASSERT3P(dev, !=, NULL);
/*
* In contrast to l2arc_add_vdev() we do not have to worry about
* l2arc_feed_thread() invalidating previous content when onlining a
* cache device. The device parameters (l2ad*) are not cleared when
* offlining the device and writing new buffers will not invalidate
* all previous content. In worst case only buffers that have not had
* their log block written to the device will be lost.
* When onlining the cache device (ie offline->online without exporting
* the pool in between) this happens:
* vdev_reopen() -> vdev_open() -> l2arc_rebuild_vdev()
* | |
* vdev_is_dead() = B_FALSE l2ad_rebuild = B_TRUE
* During the time where vdev_is_dead = B_FALSE and until l2ad_rebuild
* is set to B_TRUE we might write additional buffers to the device.
*/
l2arc_rebuild_dev(dev, reopen);
}
/* /*
* Remove a vdev from the L2ARC. * Remove a vdev from the L2ARC.
*/ */
@ -10738,7 +10765,6 @@ l2arc_log_blk_commit(l2arc_dev_t *dev, zio_t *pio, l2arc_write_callback_t *cb)
dev->l2ad_log_blk_payload_asize; dev->l2ad_log_blk_payload_asize;
l2dhdr->dh_start_lbps[0].lbp_payload_start = l2dhdr->dh_start_lbps[0].lbp_payload_start =
dev->l2ad_log_blk_payload_start; dev->l2ad_log_blk_payload_start;
_NOTE(CONSTCOND)
L2BLK_SET_LSIZE( L2BLK_SET_LSIZE(
(&l2dhdr->dh_start_lbps[0])->lbp_prop, sizeof (*lb)); (&l2dhdr->dh_start_lbps[0])->lbp_prop, sizeof (*lb));
L2BLK_SET_PSIZE( L2BLK_SET_PSIZE(

View File

@ -570,7 +570,6 @@ ddt_compress(void *src, uchar_t *dst, size_t s_len, size_t d_len)
} }
*version = cpfunc; *version = cpfunc;
/* CONSTCOND */
if (ZFS_HOST_BYTEORDER) if (ZFS_HOST_BYTEORDER)
*version |= DDT_COMPRESS_BYTEORDER_MASK; *version |= DDT_COMPRESS_BYTEORDER_MASK;

View File

@ -129,6 +129,7 @@ dnode_cons(void *arg, void *unused, int kmflag)
zfs_refcount_create(&dn->dn_tx_holds); zfs_refcount_create(&dn->dn_tx_holds);
list_link_init(&dn->dn_link); list_link_init(&dn->dn_link);
bzero(&dn->dn_next_type[0], sizeof (dn->dn_next_type));
bzero(&dn->dn_next_nblkptr[0], sizeof (dn->dn_next_nblkptr)); bzero(&dn->dn_next_nblkptr[0], sizeof (dn->dn_next_nblkptr));
bzero(&dn->dn_next_nlevels[0], sizeof (dn->dn_next_nlevels)); bzero(&dn->dn_next_nlevels[0], sizeof (dn->dn_next_nlevels));
bzero(&dn->dn_next_indblkshift[0], sizeof (dn->dn_next_indblkshift)); bzero(&dn->dn_next_indblkshift[0], sizeof (dn->dn_next_indblkshift));

View File

@ -749,7 +749,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname,
ASSERT(err == 0 || err == ENOENT); ASSERT(err == 0 || err == ENOENT);
err = zap_remove(mos, zapobj, inheritstr, tx); err = zap_remove(mos, zapobj, inheritstr, tx);
ASSERT(err == 0 || err == ENOENT); ASSERT(err == 0 || err == ENOENT);
/* FALLTHRU */ /* FALLTHROUGH */
case (ZPROP_SRC_NONE | ZPROP_SRC_RECEIVED): case (ZPROP_SRC_NONE | ZPROP_SRC_RECEIVED):
/* /*
* remove propname$recvd * remove propname$recvd

View File

@ -5617,6 +5617,13 @@ metaslab_class_throttle_reserve(metaslab_class_t *mc, int slots, int allocator,
if (GANG_ALLOCATION(flags) || (flags & METASLAB_MUST_RESERVE) || if (GANG_ALLOCATION(flags) || (flags & METASLAB_MUST_RESERVE) ||
zfs_refcount_count(&mca->mca_alloc_slots) + slots <= max) { zfs_refcount_count(&mca->mca_alloc_slots) + slots <= max) {
/* /*
* The potential race between _count() and _add() is covered
* by the allocator lock in most cases, or irrelevant due to
* GANG_ALLOCATION() or METASLAB_MUST_RESERVE set in others.
* But even if we assume some other non-existing scenario, the
* worst that can happen is few more I/Os get to allocation
* earlier, that is not a problem.
*
* We reserve the slots individually so that we can unreserve * We reserve the slots individually so that we can unreserve
* them individually when an I/O completes. * them individually when an I/O completes.
*/ */

View File

@ -4183,7 +4183,7 @@ spa_ld_get_props(spa_t *spa)
return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
if (error == 0) { if (error == 0) {
uint64_t autoreplace; uint64_t autoreplace = 0;
spa_prop_find(spa, ZPOOL_PROP_BOOTFS, &spa->spa_bootfs); spa_prop_find(spa, ZPOOL_PROP_BOOTFS, &spa->spa_bootfs);
spa_prop_find(spa, ZPOOL_PROP_AUTOREPLACE, &autoreplace); spa_prop_find(spa, ZPOOL_PROP_AUTOREPLACE, &autoreplace);

View File

@ -1033,8 +1033,8 @@ spa_ld_log_sm_metadata(spa_t *spa)
if (sls == NULL) { if (sls == NULL) {
spa_load_failed(spa, "spa_ld_log_sm_metadata(): bug " spa_load_failed(spa, "spa_ld_log_sm_metadata(): bug "
"encountered: could not find log spacemap for " "encountered: could not find log spacemap for "
"TXG %ld [error %d]", "TXG %llu [error %d]",
metaslab_unflushed_txg(m), ENOENT); (u_longlong_t)metaslab_unflushed_txg(m), ENOENT);
return (ENOENT); return (ENOENT);
} }
sls->sls_mscount++; sls->sls_mscount++;

View File

@ -389,7 +389,6 @@ uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024;
int spa_allocators = 4; int spa_allocators = 4;
/*PRINTFLIKE2*/
void void
spa_load_failed(spa_t *spa, const char *fmt, ...) spa_load_failed(spa_t *spa, const char *fmt, ...)
{ {
@ -404,7 +403,6 @@ spa_load_failed(spa_t *spa, const char *fmt, ...)
spa->spa_trust_config ? "trusted" : "untrusted", buf); spa->spa_trust_config ? "trusted" : "untrusted", buf);
} }
/*PRINTFLIKE2*/
void void
spa_load_note(spa_t *spa, const char *fmt, ...) spa_load_note(spa_t *spa, const char *fmt, ...)
{ {
@ -1853,7 +1851,14 @@ spa_update_dspace(spa_t *spa)
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER); spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
vdev_t *vd = vdev_t *vd =
vdev_lookup_top(spa, spa->spa_vdev_removal->svr_vdev_id); vdev_lookup_top(spa, spa->spa_vdev_removal->svr_vdev_id);
if (vd->vdev_mg->mg_class == spa_normal_class(spa)) { /*
* If the stars align, we can wind up here after
* vdev_remove_complete() has cleared vd->vdev_mg but before
* spa->spa_vdev_removal gets cleared, so we must check before
* we dereference.
*/
if (vd->vdev_mg &&
vd->vdev_mg->mg_class == spa_normal_class(spa)) {
spa->spa_dspace -= spa_deflate(spa) ? spa->spa_dspace -= spa_deflate(spa) ?
vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space; vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space;
} }

View File

@ -137,7 +137,6 @@ int zfs_nocacheflush = 0;
uint64_t zfs_vdev_max_auto_ashift = ASHIFT_MAX; uint64_t zfs_vdev_max_auto_ashift = ASHIFT_MAX;
uint64_t zfs_vdev_min_auto_ashift = ASHIFT_MIN; uint64_t zfs_vdev_min_auto_ashift = ASHIFT_MIN;
/*PRINTFLIKE2*/
void void
vdev_dbgmsg(vdev_t *vd, const char *fmt, ...) vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
{ {
@ -3457,7 +3456,8 @@ vdev_load(vdev_t *vd)
vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN,
VDEV_AUX_CORRUPT_DATA); VDEV_AUX_CORRUPT_DATA);
vdev_dbgmsg(vd, "vdev_load: zap_lookup(top_zap=%llu) " vdev_dbgmsg(vd, "vdev_load: zap_lookup(top_zap=%llu) "
"failed [error=%d]", vd->vdev_top_zap, error); "failed [error=%d]",
(u_longlong_t)vd->vdev_top_zap, error);
return (error); return (error);
} }
} }

View File

@ -165,8 +165,8 @@ vdev_raidz_math_generate(raidz_map_t *rm, raidz_row_t *rr)
break; break;
default: default:
gen_parity = NULL; gen_parity = NULL;
cmn_err(CE_PANIC, "invalid RAID-Z configuration %d", cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
raidz_parity(rm)); (u_longlong_t)raidz_parity(rm));
break; break;
} }
@ -257,8 +257,8 @@ vdev_raidz_math_reconstruct(raidz_map_t *rm, raidz_row_t *rr,
rec_fn = reconstruct_fun_pqr_sel(rm, parity_valid, nbaddata); rec_fn = reconstruct_fun_pqr_sel(rm, parity_valid, nbaddata);
break; break;
default: default:
cmn_err(CE_PANIC, "invalid RAID-Z configuration %d", cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
raidz_parity(rm)); (u_longlong_t)raidz_parity(rm));
break; break;
} }

View File

@ -79,7 +79,6 @@ zfs_log_create_txtype(zil_create_t type, vsecattr_t *vsecp, vattr_t *vap)
return (TX_CREATE_ACL); return (TX_CREATE_ACL);
else else
return (TX_CREATE_ATTR); return (TX_CREATE_ATTR);
/*NOTREACHED*/
case Z_DIR: case Z_DIR:
if (vsecp == NULL && !isxvattr) if (vsecp == NULL && !isxvattr)
return (TX_MKDIR); return (TX_MKDIR);
@ -126,9 +125,11 @@ zfs_log_xvattr(lr_attr_t *lrattr, xvattr_t *xvap)
/* Now pack the attributes up in a single uint64_t */ /* Now pack the attributes up in a single uint64_t */
attrs = (uint64_t *)bitmap; attrs = (uint64_t *)bitmap;
crtime = attrs + 1;
scanstamp = (caddr_t)(crtime + 2);
*attrs = 0; *attrs = 0;
crtime = attrs + 1;
bzero(crtime, 2 * sizeof (uint64_t));
scanstamp = (caddr_t)(crtime + 2);
bzero(scanstamp, AV_SCANSTAMP_SZ);
if (XVA_ISSET_REQ(xvap, XAT_READONLY)) if (XVA_ISSET_REQ(xvap, XAT_READONLY))
*attrs |= (xoap->xoa_readonly == 0) ? 0 : *attrs |= (xoap->xoa_readonly == 0) ? 0 :
XAT0_READONLY; XAT0_READONLY;

View File

@ -71,7 +71,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode,
bzero(vap, sizeof (*vap)); bzero(vap, sizeof (*vap));
vap->va_mask = (uint_t)mask; vap->va_mask = (uint_t)mask;
vap->va_mode = mode; vap->va_mode = mode;
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__APPLE__)
vap->va_type = IFTOVT(mode); vap->va_type = IFTOVT(mode);
#endif #endif
vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid; vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid;
@ -519,8 +519,8 @@ zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap)
zfs_replay_fuid_domain(start, &start, zfs_replay_fuid_domain(start, &start,
lr->lr_uid, lr->lr_gid); lr->lr_uid, lr->lr_gid);
name = (char *)start; name = (char *)start;
/* FALLTHROUGH */ /* FALLTHROUGH */
case TX_CREATE: case TX_CREATE:
if (name == NULL) if (name == NULL)
name = (char *)start; name = (char *)start;
@ -537,8 +537,8 @@ zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap)
zfs_replay_fuid_domain(start, &start, zfs_replay_fuid_domain(start, &start,
lr->lr_uid, lr->lr_gid); lr->lr_uid, lr->lr_gid);
name = (char *)start; name = (char *)start;
/* FALLTHROUGH */ /* FALLTHROUGH */
case TX_MKDIR: case TX_MKDIR:
if (name == NULL) if (name == NULL)
name = (char *)(lr + 1); name = (char *)(lr + 1);

View File

@ -1619,7 +1619,7 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb)
lr_t *lrcb, *lrc; lr_t *lrcb, *lrc;
lr_write_t *lrwb, *lrw; lr_write_t *lrwb, *lrw;
char *lr_buf; char *lr_buf;
uint64_t dlen, dnow, lwb_sp, reclen, txg, max_log_data; uint64_t dlen, dnow, dpad, lwb_sp, reclen, txg, max_log_data;
ASSERT(MUTEX_HELD(&zilog->zl_issuer_lock)); ASSERT(MUTEX_HELD(&zilog->zl_issuer_lock));
ASSERT3P(lwb, !=, NULL); ASSERT3P(lwb, !=, NULL);
@ -1653,8 +1653,9 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb)
if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) { if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) {
dlen = P2ROUNDUP_TYPED( dlen = P2ROUNDUP_TYPED(
lrw->lr_length, sizeof (uint64_t), uint64_t); lrw->lr_length, sizeof (uint64_t), uint64_t);
dpad = dlen - lrw->lr_length;
} else { } else {
dlen = 0; dlen = dpad = 0;
} }
reclen = lrc->lrc_reclen; reclen = lrc->lrc_reclen;
zilog->zl_cur_used += (reclen + dlen); zilog->zl_cur_used += (reclen + dlen);
@ -1748,6 +1749,9 @@ cont:
error = zilog->zl_get_data(itx->itx_private, error = zilog->zl_get_data(itx->itx_private,
itx->itx_gen, lrwb, dbuf, lwb, itx->itx_gen, lrwb, dbuf, lwb,
lwb->lwb_write_zio); lwb->lwb_write_zio);
if (dbuf != NULL && error == 0 && dnow == dlen)
/* Zero any padding bytes in the last block. */
bzero((char *)dbuf + lrwb->lr_length, dpad);
if (error == EIO) { if (error == EIO) {
txg_wait_synced(zilog->zl_dmu_pool, txg); txg_wait_synced(zilog->zl_dmu_pool, txg);
@ -1785,18 +1789,19 @@ cont:
} }
itx_t * itx_t *
zil_itx_create(uint64_t txtype, size_t lrsize) zil_itx_create(uint64_t txtype, size_t olrsize)
{ {
size_t itxsize; size_t itxsize, lrsize;
itx_t *itx; itx_t *itx;
lrsize = P2ROUNDUP_TYPED(lrsize, sizeof (uint64_t), size_t); lrsize = P2ROUNDUP_TYPED(olrsize, sizeof (uint64_t), size_t);
itxsize = offsetof(itx_t, itx_lr) + lrsize; itxsize = offsetof(itx_t, itx_lr) + lrsize;
itx = zio_data_buf_alloc(itxsize); itx = zio_data_buf_alloc(itxsize);
itx->itx_lr.lrc_txtype = txtype; itx->itx_lr.lrc_txtype = txtype;
itx->itx_lr.lrc_reclen = lrsize; itx->itx_lr.lrc_reclen = lrsize;
itx->itx_lr.lrc_seq = 0; /* defensive */ itx->itx_lr.lrc_seq = 0; /* defensive */
bzero((char *)&itx->itx_lr + olrsize, lrsize - olrsize);
itx->itx_sync = B_TRUE; /* default is synchronous */ itx->itx_sync = B_TRUE; /* default is synchronous */
itx->itx_callback = NULL; itx->itx_callback = NULL;
itx->itx_callback_data = NULL; itx->itx_callback_data = NULL;

View File

@ -567,18 +567,17 @@ fi
. "$STF_SUITE/include/default.cfg" . "$STF_SUITE/include/default.cfg"
msg
msg "--- Configuration ---"
msg "Runfiles: $RUNFILES"
msg "STF_TOOLS: $STF_TOOLS"
msg "STF_SUITE: $STF_SUITE"
msg "STF_PATH: $STF_PATH"
# #
# No DISKS have been provided so a basic file or loopback based devices # No DISKS have been provided so a basic file or loopback based devices
# must be created for the test suite to use. # must be created for the test suite to use.
# #
if [ -z "${DISKS}" ]; then if [ -z "${DISKS}" ]; then
#
# If this is a performance run, prevent accidental use of
# loopback devices.
#
[ "$TAGS" = "perf" ] && fail "Running perf tests without disks."
# #
# Create sparse files for the test suite. These may be used # Create sparse files for the test suite. These may be used
# directory or have loopback devices layered on them. # directory or have loopback devices layered on them.
@ -619,8 +618,14 @@ if [ -z "${DISKS}" ]; then
fi fi
fi fi
#
# It may be desirable to test with fewer disks than the default when running
# the performance tests, but the functional tests require at least three.
#
NUM_DISKS=$(echo "${DISKS}" | awk '{print NF}') NUM_DISKS=$(echo "${DISKS}" | awk '{print NF}')
if [ "$TAGS" != "perf" ]; then
[ "$NUM_DISKS" -lt 3 ] && fail "Not enough disks ($NUM_DISKS/3 minimum)" [ "$NUM_DISKS" -lt 3 ] && fail "Not enough disks ($NUM_DISKS/3 minimum)"
fi
# #
# Disable SELinux until the ZFS Test Suite has been updated accordingly. # Disable SELinux until the ZFS Test Suite has been updated accordingly.
@ -637,6 +642,12 @@ if [ -e /sys/module/zfs/parameters/zfs_dbgmsg_enable ]; then
sudo /bin/sh -c "echo 0 >/proc/spl/kstat/zfs/dbgmsg" sudo /bin/sh -c "echo 0 >/proc/spl/kstat/zfs/dbgmsg"
fi fi
msg
msg "--- Configuration ---"
msg "Runfiles: $RUNFILES"
msg "STF_TOOLS: $STF_TOOLS"
msg "STF_SUITE: $STF_SUITE"
msg "STF_PATH: $STF_PATH"
msg "FILEDIR: $FILEDIR" msg "FILEDIR: $FILEDIR"
msg "FILES: $FILES" msg "FILES: $FILES"
msg "LOOPBACKS: $LOOPBACKS" msg "LOOPBACKS: $LOOPBACKS"

View File

@ -935,8 +935,7 @@ tags = ['functional', 'log_spacemap']
[tests/functional/l2arc] [tests/functional/l2arc]
tests = ['l2arc_arcstats_pos', 'l2arc_mfuonly_pos', 'l2arc_l2miss_pos', tests = ['l2arc_arcstats_pos', 'l2arc_mfuonly_pos', 'l2arc_l2miss_pos',
'persist_l2arc_001_pos', 'persist_l2arc_002_pos', 'persist_l2arc_001_pos', 'persist_l2arc_002_pos',
'persist_l2arc_003_neg', 'persist_l2arc_004_pos', 'persist_l2arc_005_pos', 'persist_l2arc_003_neg', 'persist_l2arc_004_pos', 'persist_l2arc_005_pos']
'persist_l2arc_006_pos', 'persist_l2arc_007_pos', 'persist_l2arc_008_pos']
tags = ['functional', 'l2arc'] tags = ['functional', 'l2arc']
[tests/functional/zpool_influxdb] [tests/functional/zpool_influxdb]

View File

@ -223,8 +223,6 @@ maybe = {
'history/history_008_pos': ['FAIL', known_reason], 'history/history_008_pos': ['FAIL', known_reason],
'history/history_010_pos': ['SKIP', exec_reason], 'history/history_010_pos': ['SKIP', exec_reason],
'io/mmap': ['SKIP', fio_reason], 'io/mmap': ['SKIP', fio_reason],
'l2arc/persist_l2arc_005_pos': ['FAIL', known_reason],
'l2arc/persist_l2arc_007_pos': ['FAIL', '11887'],
'largest_pool/largest_pool_001_pos': ['FAIL', known_reason], 'largest_pool/largest_pool_001_pos': ['FAIL', known_reason],
'mmp/mmp_on_uberblocks': ['FAIL', known_reason], 'mmp/mmp_on_uberblocks': ['FAIL', known_reason],
'pyzfs/pyzfs_unittest': ['SKIP', python_deps_reason], 'pyzfs/pyzfs_unittest': ['SKIP', python_deps_reason],

View File

@ -4,3 +4,5 @@ pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
pkgexec_PROGRAMS = mkbusy pkgexec_PROGRAMS = mkbusy
mkbusy_SOURCES = mkbusy.c mkbusy_SOURCES = mkbusy.c
mkbusy_LDADD = $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la

View File

@ -29,19 +29,21 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <libzutil.h>
static void
static __attribute__((noreturn)) void
usage(char *progname) usage(char *progname)
{ {
(void) fprintf(stderr, "Usage: %s <dirname|filename>\n", progname); (void) fprintf(stderr, "Usage: %s <dirname|filename>\n", progname);
exit(1); exit(1);
} }
static void static __attribute__((noreturn)) void
fail(char *err, int rval) fail(char *err)
{ {
perror(err); perror(err);
exit(rval); exit(1);
} }
static void static void
@ -50,7 +52,7 @@ daemonize(void)
pid_t pid; pid_t pid;
if ((pid = fork()) < 0) { if ((pid = fork()) < 0) {
fail("fork", 1); fail("fork");
} else if (pid != 0) { } else if (pid != 0) {
(void) fprintf(stdout, "%ld\n", (long)pid); (void) fprintf(stdout, "%ld\n", (long)pid);
exit(0); exit(0);
@ -65,24 +67,14 @@ daemonize(void)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int ret, c; int c;
boolean_t isdir = B_FALSE; boolean_t isdir = B_FALSE;
boolean_t fflag = B_FALSE;
boolean_t rflag = B_FALSE;
struct stat sbuf; struct stat sbuf;
char *fpath = NULL; char *fpath = NULL;
char *prog = argv[0]; char *prog = argv[0];
while ((c = getopt(argc, argv, "fr")) != -1) { while ((c = getopt(argc, argv, "")) != -1) {
switch (c) { switch (c) {
/* Open the file or directory read only */
case 'r':
rflag = B_TRUE;
break;
/* Run in the foreground */
case 'f':
fflag = B_TRUE;
break;
default: default:
usage(prog); usage(prog);
} }
@ -94,84 +86,68 @@ main(int argc, char *argv[])
if (argc != 1) if (argc != 1)
usage(prog); usage(prog);
if ((ret = stat(argv[0], &sbuf)) != 0) { if (stat(argv[0], &sbuf) != 0) {
char *arg, *dname, *fname; char *arg;
int arglen; const char *dname, *fname;
char *slash; size_t arglen;
int rc; ssize_t dnamelen;
/* /*
* The argument supplied doesn't exist. Copy the path, and * The argument supplied doesn't exist. Copy the path, and
* remove the trailing slash if present. * remove the trailing slash if present.
*/ */
if ((arg = strdup(argv[0])) == NULL) if ((arg = strdup(argv[0])) == NULL)
fail("strdup", 1); fail("strdup");
arglen = strlen(arg); arglen = strlen(arg);
if (arg[arglen - 1] == '/') if (arg[arglen - 1] == '/')
arg[arglen - 1] = '\0'; arg[arglen - 1] = '\0';
/* /* Get the directory and file names. */
* Get the directory and file names, using the current directory fname = zfs_basename(arg);
* if the provided path doesn't specify a directory at all. dname = arg;
*/ if ((dnamelen = zfs_dirnamelen(arg)) != -1)
if ((slash = strrchr(arg, '/')) == NULL) { arg[dnamelen] = '\0';
dname = strdup("."); else
fname = strdup(arg); dname = ".";
} else {
*slash = '\0';
dname = strdup(arg);
fname = strdup(slash + 1);
}
free(arg);
if (dname == NULL || fname == NULL)
fail("strdup", 1);
/* The directory portion of the path must exist */ /* The directory portion of the path must exist */
if ((ret = stat(dname, &sbuf)) != 0 || !(sbuf.st_mode & if (stat(dname, &sbuf) != 0 || !(sbuf.st_mode & S_IFDIR))
S_IFDIR))
usage(prog); usage(prog);
rc = asprintf(&fpath, "%s/%s", dname, fname); if (asprintf(&fpath, "%s/%s", dname, fname) == -1)
free(dname); fail("asprintf");
free(fname);
if (rc == -1 || fpath == NULL)
fail("asprintf", 1);
} else if ((sbuf.st_mode & S_IFMT) == S_IFREG || free(arg);
(sbuf.st_mode & S_IFMT) == S_IFLNK || } else
(sbuf.st_mode & S_IFMT) == S_IFCHR || switch (sbuf.st_mode & S_IFMT) {
(sbuf.st_mode & S_IFMT) == S_IFBLK) { case S_IFDIR:
fpath = strdup(argv[0]);
} else if ((sbuf.st_mode & S_IFMT) == S_IFDIR) {
fpath = strdup(argv[0]);
isdir = B_TRUE; isdir = B_TRUE;
} else { /* FALLTHROUGH */
case S_IFLNK:
case S_IFCHR:
case S_IFBLK:
if ((fpath = strdup(argv[0])) == NULL)
fail("strdup");
break;
default:
usage(prog); usage(prog);
} }
if (fpath == NULL) if (!isdir) {
fail("strdup", 1); int fd;
if (isdir == B_FALSE) { if ((fd = open(fpath, O_CREAT | O_RDWR, 0600)) < 0)
int fd, flags; fail("open");
mode_t mode = S_IRUSR | S_IWUSR;
flags = rflag == B_FALSE ? O_CREAT | O_RDWR : O_RDONLY;
if ((fd = open(fpath, flags, mode)) < 0)
fail("open", 1);
} else { } else {
DIR *dp; DIR *dp;
if ((dp = opendir(fpath)) == NULL) if ((dp = opendir(fpath)) == NULL)
fail("opendir", 1); fail("opendir");
} }
free(fpath); free(fpath);
if (fflag == B_FALSE)
daemonize(); daemonize();
(void) pause(); (void) pause();
/* NOTREACHED */
return (0); return (0);
} }

View File

@ -44,7 +44,7 @@
#define FILE_MODE (S_ISVTX + S_IRUSR + S_IWUSR) #define FILE_MODE (S_ISVTX + S_IRUSR + S_IWUSR)
static void usage(void); static void usage(void) __attribute__((noreturn));
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -278,5 +278,4 @@ static void usage()
(void) fprintf(stderr, gettext( (void) fprintf(stderr, gettext(
"Usage: mkfile [-nv] <size>[g|k|b|m] <name1> [<name2>] ...\n")); "Usage: mkfile [-nv] <size>[g|k|b|m] <name1> [<name2>] ...\n"));
exit(1); exit(1);
/* NOTREACHED */
} }

View File

@ -66,19 +66,15 @@ normal_writer(void *filename)
err(1, "failed to open %s", file_path); err(1, "failed to open %s", file_path);
} }
char *buf = malloc(1); char buf;
while (1) { while (1) {
write_num = write(fd, buf, 1); write_num = write(fd, &buf, 1);
if (write_num == 0) { if (write_num == 0) {
err(1, "write failed!"); err(1, "write failed!");
break; break;
} }
lseek(fd, page_size, SEEK_CUR); lseek(fd, page_size, SEEK_CUR);
} }
if (buf) {
free(buf);
}
} }
static void * static void *
@ -156,7 +152,6 @@ main(int argc, char **argv)
err(1, "pthread_create map_writer failed."); err(1, "pthread_create map_writer failed.");
} }
/* NOTREACHED */
pthread_join(map_write_tid, NULL); pthread_join(map_write_tid, NULL);
return (0); return (0);
} }

View File

@ -27,7 +27,7 @@ COMPRESSED_ARC_ENABLED compressed_arc_enabled zfs_compressed_arc_enabled
CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS condense.indirect_commit_entry_delay_ms zfs_condense_indirect_commit_entry_delay_ms CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS condense.indirect_commit_entry_delay_ms zfs_condense_indirect_commit_entry_delay_ms
CONDENSE_INDIRECT_OBSOLETE_PCT condense.indirect_obsolete_pct zfs_condense_indirect_obsolete_pct CONDENSE_INDIRECT_OBSOLETE_PCT condense.indirect_obsolete_pct zfs_condense_indirect_obsolete_pct
CONDENSE_MIN_MAPPING_BYTES condense.min_mapping_bytes zfs_condense_min_mapping_bytes CONDENSE_MIN_MAPPING_BYTES condense.min_mapping_bytes zfs_condense_min_mapping_bytes
DBUF_CACHE_MAX_BYTES dbuf_cache.max_bytes dbuf_cache_max_bytes DBUF_CACHE_SHIFT dbuf.cache_shift dbuf_cache_shift
DEADMAN_CHECKTIME_MS deadman.checktime_ms zfs_deadman_checktime_ms DEADMAN_CHECKTIME_MS deadman.checktime_ms zfs_deadman_checktime_ms
DEADMAN_FAILMODE deadman.failmode zfs_deadman_failmode DEADMAN_FAILMODE deadman.failmode zfs_deadman_failmode
DEADMAN_SYNCTIME_MS deadman.synctime_ms zfs_deadman_synctime_ms DEADMAN_SYNCTIME_MS deadman.synctime_ms zfs_deadman_synctime_ms

View File

@ -36,7 +36,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <sys/note.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/stdtypes.h> #include <sys/stdtypes.h>
@ -167,7 +166,6 @@ main(int argc, char *argv[])
(void) printf("FAILED!\n"); \ (void) printf("FAILED!\n"); \
failed = B_TRUE; \ failed = B_TRUE; \
} \ } \
NOTE(CONSTCOND) \
} while (0) } while (0)
#define EDONR_PERF_TEST(mode) \ #define EDONR_PERF_TEST(mode) \
@ -194,7 +192,6 @@ main(int argc, char *argv[])
} \ } \
(void) printf("Edon-R-%-6s%llu us (%.02f CPB)\n", #mode,\ (void) printf("Edon-R-%-6s%llu us (%.02f CPB)\n", #mode,\
(u_longlong_t)delta, cpb); \ (u_longlong_t)delta, cpb); \
NOTE(CONSTCOND) \
} while (0) } while (0)
(void) printf("Running algorithm correctness tests:\n"); (void) printf("Running algorithm correctness tests:\n");

View File

@ -40,7 +40,6 @@
#define _SHA2_IMPL #define _SHA2_IMPL
#include <sys/sha2.h> #include <sys/sha2.h>
#include <sys/stdtypes.h> #include <sys/stdtypes.h>
#define NOTE(x)
/* /*
@ -196,7 +195,6 @@ main(int argc, char *argv[])
(void) printf("FAILED!\n"); \ (void) printf("FAILED!\n"); \
failed = B_TRUE; \ failed = B_TRUE; \
} \ } \
NOTE(CONSTCOND) \
} while (0) } while (0)
#define SHA2_PERF_TEST(mode, diglen) \ #define SHA2_PERF_TEST(mode, diglen) \
@ -223,7 +221,6 @@ main(int argc, char *argv[])
} \ } \
(void) printf("SHA%-9s%llu us (%.02f CPB)\n", #mode, \ (void) printf("SHA%-9s%llu us (%.02f CPB)\n", #mode, \
(u_longlong_t)delta, cpb); \ (u_longlong_t)delta, cpb); \
NOTE(CONSTCOND) \
} while (0) } while (0)
(void) printf("Running algorithm correctness tests:\n"); (void) printf("Running algorithm correctness tests:\n");

View File

@ -38,7 +38,6 @@
#include <stdio.h> #include <stdio.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/stdtypes.h> #include <sys/stdtypes.h>
#define NOTE(x)
/* /*
* Skein test suite using values from the Skein V1.3 specification found at: * Skein test suite using values from the Skein V1.3 specification found at:
@ -285,7 +284,6 @@ main(int argc, char *argv[])
(void) printf("FAILED!\n"); \ (void) printf("FAILED!\n"); \
failed = B_TRUE; \ failed = B_TRUE; \
} \ } \
NOTE(CONSTCOND) \
} while (0) } while (0)
#define SKEIN_PERF_TEST(mode, diglen) \ #define SKEIN_PERF_TEST(mode, diglen) \
@ -314,7 +312,6 @@ main(int argc, char *argv[])
} \ } \
(void) printf("Skein" #mode "/" #diglen "\t%llu us " \ (void) printf("Skein" #mode "/" #diglen "\t%llu us " \
"(%.02f CPB)\n", (u_longlong_t)delta, cpb); \ "(%.02f CPB)\n", (u_longlong_t)delta, cpb); \
NOTE(CONSTCOND) \
} while (0) } while (0)
(void) printf("Running algorithm correctness tests:\n"); (void) printf("Running algorithm correctness tests:\n");

View File

@ -9,10 +9,7 @@ dist_pkgdata_SCRIPTS = \
persist_l2arc_002_pos.ksh \ persist_l2arc_002_pos.ksh \
persist_l2arc_003_neg.ksh \ persist_l2arc_003_neg.ksh \
persist_l2arc_004_pos.ksh \ persist_l2arc_004_pos.ksh \
persist_l2arc_005_pos.ksh \ persist_l2arc_005_pos.ksh
persist_l2arc_006_pos.ksh \
persist_l2arc_007_pos.ksh \
persist_l2arc_008_pos.ksh
dist_pkgdata_DATA = \ dist_pkgdata_DATA = \
l2arc.cfg l2arc.cfg

View File

@ -96,7 +96,6 @@ typeset l2_mru_end=$(get_arcstat l2_mru_asize)
typeset l2_prefetch_end=$(get_arcstat l2_prefetch_asize) typeset l2_prefetch_end=$(get_arcstat l2_prefetch_asize)
typeset l2_asize_end=$(get_arcstat l2_asize) typeset l2_asize_end=$(get_arcstat l2_asize)
log_must test $(( $l2_mfu_end - $l2_mfu_init )) -gt 0
log_must test $(( $l2_mru_end + $l2_mfu_end + $l2_prefetch_end - \ log_must test $(( $l2_mru_end + $l2_mfu_end + $l2_prefetch_end - \
$l2_asize_end )) -eq 0 $l2_asize_end )) -eq 0
log_must test $(( $l2_mru_init + $l2_mfu_init + $l2_prefetch_init - \ log_must test $(( $l2_mru_init + $l2_mfu_init + $l2_prefetch_init - \

View File

@ -23,25 +23,24 @@
# #
# DESCRIPTION: # DESCRIPTION:
# Persistent L2ARC restores all written log blocks # Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not
# present.
# #
# STRATEGY: # STRATEGY:
# 1. Create pool with a cache device. # 1. Create pool with a cache device.
# 2. Create a random file in that pool, smaller than the cache device # 2. Create a random file in that pool and random read for 10 sec.
# and random read for 10 sec. # 3. Read the amount of log blocks written from the header of the
# 3. Export pool. # L2ARC device.
# 4. Read amount of log blocks written. # 4. Offline the L2ARC device and export pool.
# 5. Import pool. # 5. Import pool and online the L2ARC device.
# 6. Read amount of log blocks built. # 6. Read the amount of log blocks rebuilt in arcstats and compare to
# 7. Compare the two amounts. # (3).
# 8. Read the file written in (2) and check if l2_hits in # 7. Check if the labels of the L2ARC device are intact.
# /proc/spl/kstat/zfs/arcstats increased.
# 9. Check if the labels of the L2ARC device are intact.
# #
verify_runnable "global" verify_runnable "global"
log_assert "Persistent L2ARC restores all written log blocks." log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not present."
function cleanup function cleanup
{ {
@ -50,47 +49,47 @@ function cleanup
fi fi
log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE \
$rebuild_blocks_min_l2size
} }
log_onexit cleanup log_onexit cleanup
# L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches # L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches
typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH) typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH)
typeset rebuild_blocks_min_l2size=$(get_tunable L2ARC_REBUILD_BLOCKS_MIN_L2SIZE)
log_must set_tunable32 L2ARC_NOPREFETCH 0 log_must set_tunable32 L2ARC_NOPREFETCH 0
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE 0
typeset fill_mb=800 typeset fill_mb=800
typeset cache_sz=$(( 2 * $fill_mb )) typeset cache_sz=$(( floor($fill_mb / 2) ))
export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE log_must truncate -s ${cache_sz}M $VDEV_CACHE
typeset log_blk_start=$(get_arcstat l2_log_blk_writes)
log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
log_must fio $FIO_SCRIPTS/mkfiles.fio log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
log_must zpool export $TESTPOOL log_must zpool export $TESTPOOL
arcstat_quiescence_noecho l2_feeds arcstat_quiescence_noecho l2_feeds
typeset log_blk_end=$(get_arcstat l2_log_blk_writes) typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
typeset log_blk_rebuild_start=$(get_arcstat l2_rebuild_log_blks) typeset l2_dh_log_blk=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
log_must zpool import -d $VDIR $TESTPOOL log_must zpool import -d $VDIR $TESTPOOL
log_must zpool online $TESTPOOL $VDEV_CACHE
typeset l2_hits_start=$(get_arcstat l2_hits)
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
typeset log_blk_rebuild_end=$(arcstat_quiescence_echo l2_rebuild_log_blks) typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
typeset l2_hits_end=$(get_arcstat l2_hits)
log_must test $(( $log_blk_rebuild_end - $log_blk_rebuild_start )) -eq \ log_must test $l2_dh_log_blk -eq $(( $l2_rebuild_log_blk_end - \
$(( $log_blk_end - $log_blk_start )) $l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk -gt 0
log_must test $l2_hits_end -gt $l2_hits_start
log_must zpool offline $TESTPOOL $VDEV_CACHE log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
@ -99,4 +98,4 @@ log_must zdb -lq $VDEV_CACHE
log_must zpool destroy -f $TESTPOOL log_must zpool destroy -f $TESTPOOL
log_pass "Persistent L2ARC restores all written log blocks." log_pass "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not present."

View File

@ -20,31 +20,26 @@
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/l2arc/l2arc.cfg . $STF_SUITE/tests/functional/l2arc/l2arc.cfg
. $STF_SUITE/tests/functional/cli_root/zfs_load-key/zfs_load-key_common.kshlib
# #
# DESCRIPTION: # DESCRIPTION:
# Persistent L2ARC restores all written log blocks with encryption # Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present.
# #
# STRATEGY: # STRATEGY:
# 1. Create pool with a cache device. # 1. Create pool with a cache device.
# 2. Create a an encrypted ZFS file system. # 2. Create a random file in that pool and random read for 10 sec.
# 3. Create a random file in the entrypted file system, # 3. Offline the L2ARC device.
# smaller than the cache device, and random read for 10 sec. # 4. Read the amount of log blocks written from the header of the
# 4. Export pool. # L2ARC device.
# 5. Read amount of log blocks written. # 5. Online the L2ARC device.
# 6. Import pool. # 6. Read the amount of log blocks rebuilt in arcstats and compare to
# 7. Mount the encrypted ZFS file system. # (4).
# 8. Read amount of log blocks built. # 7. Check if the labels of the L2ARC device are intact.
# 9. Compare the two amounts.
# 10. Read the file written in (3) and check if l2_hits in
# /proc/spl/kstat/zfs/arcstats increased.
# 11. Check if the labels of the L2ARC device are intact.
# #
verify_runnable "global" verify_runnable "global"
log_assert "Persistent L2ARC restores all written log blocks with encryption." log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present."
function cleanup function cleanup
{ {
@ -53,51 +48,49 @@ function cleanup
fi fi
log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE \
$rebuild_blocks_min_l2size
} }
log_onexit cleanup log_onexit cleanup
# L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches # L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches
typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH) typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH)
typeset rebuild_blocks_min_l2size=$(get_tunable L2ARC_REBUILD_BLOCKS_MIN_L2SIZE)
log_must set_tunable32 L2ARC_NOPREFETCH 0 log_must set_tunable32 L2ARC_NOPREFETCH 0
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE 0
typeset fill_mb=800 typeset fill_mb=800
typeset cache_sz=$(( 2 * $fill_mb )) typeset cache_sz=$(( floor($fill_mb / 2) ))
export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE log_must truncate -s ${cache_sz}M $VDEV_CACHE
typeset log_blk_start=$(get_arcstat l2_log_blk_writes)
log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
log_must eval "echo $PASSPHRASE | zfs create -o encryption=on" \
"-o keyformat=passphrase $TESTPOOL/$TESTFS1"
log_must fio $FIO_SCRIPTS/mkfiles.fio log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
log_must zpool export $TESTPOOL log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_feeds
typeset log_blk_end=$(get_arcstat l2_log_blk_writes)
typeset log_blk_rebuild_start=$(get_arcstat l2_rebuild_log_blks)
log_must zpool import -d $VDIR $TESTPOOL
log_must eval "echo $PASSPHRASE | zfs mount -l $TESTPOOL/$TESTFS1"
typeset l2_hits_start=$(get_arcstat l2_hits)
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
typeset log_blk_rebuild_end=$(arcstat_quiescence_echo l2_rebuild_log_blks) typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
typeset l2_hits_end=$(get_arcstat l2_hits) typeset l2_dh_log_blk=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
log_must test $(( $log_blk_rebuild_end - $log_blk_rebuild_start )) -eq \ log_must zpool online $TESTPOOL $VDEV_CACHE
$(( $log_blk_end - $log_blk_start )) arcstat_quiescence_noecho l2_size
log_must test $l2_hits_end -gt $l2_hits_start typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
# Upon onlining the cache device we might write additional blocks to it
# before it is marked for rebuild as the l2ad_* parameters are not cleared
# when offlining the device. See comment in l2arc_rebuild_vdev().
# So we cannot compare the amount of rebuilt log blocks to the amount of log
# blocks read from the header of the device.
log_must test $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start )) -gt 0
log_must test $l2_dh_log_blk -gt 0
log_must zpool offline $TESTPOOL $VDEV_CACHE log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size arcstat_quiescence_noecho l2_size
@ -106,4 +99,4 @@ log_must zdb -lq $VDEV_CACHE
log_must zpool destroy -f $TESTPOOL log_must zpool destroy -f $TESTPOOL
log_pass "Persistent L2ARC restores all written log blocks with encryption." log_pass "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present."

View File

@ -1,101 +0,0 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# 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.
#
# CDDL HEADER END
#
#
# Copyright (c) 2020, George Amanakis. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/l2arc/l2arc.cfg
#
# DESCRIPTION:
# Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not
# present.
#
# STRATEGY:
# 1. Create pool with a cache device.
# 2. Create a random file in that pool and random read for 10 sec.
# 3. Read the amount of log blocks written from the header of the
# L2ARC device.
# 4. Offline the L2ARC device and export pool.
# 5. Import pool and online the L2ARC device.
# 6. Read the amount of log blocks rebuilt in arcstats and compare to
# (3).
# 7. Check if the labels of the L2ARC device are intact.
#
verify_runnable "global"
log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not present."
function cleanup
{
if poolexists $TESTPOOL ; then
destroy_pool $TESTPOOL
fi
log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE \
$rebuild_blocks_min_l2size
}
log_onexit cleanup
# L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches
typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH)
typeset rebuild_blocks_min_l2size=$(get_tunable L2ARC_REBUILD_BLOCKS_MIN_L2SIZE)
log_must set_tunable32 L2ARC_NOPREFETCH 0
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE 0
typeset fill_mb=800
typeset cache_sz=$(( floor($fill_mb / 2) ))
export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE
log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
log_must zpool export $TESTPOOL
arcstat_quiescence_noecho l2_feeds
typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
typeset l2_dh_log_blk=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
log_must zpool import -d $VDIR $TESTPOOL
log_must zpool online $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
log_must test $l2_dh_log_blk -eq $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk -gt 0
log must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
log_must zdb -lq $VDEV_CACHE
log_must zpool destroy -f $TESTPOOL
log_pass "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not present."

View File

@ -1,97 +0,0 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# 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.
#
# CDDL HEADER END
#
#
# Copyright (c) 2020, George Amanakis. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/l2arc/l2arc.cfg
#
# DESCRIPTION:
# Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present.
#
# STRATEGY:
# 1. Create pool with a cache device.
# 2. Create a random file in that pool and random read for 10 sec.
# 3. Offline the L2ARC device.
# 4. Read the amount of log blocks written from the header of the
# L2ARC device.
# 5. Online the L2ARC device.
# 6. Read the amount of log blocks rebuilt in arcstats and compare to
# (4).
# 7. Check if the labels of the L2ARC device are intact.
#
verify_runnable "global"
log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present."
function cleanup
{
if poolexists $TESTPOOL ; then
destroy_pool $TESTPOOL
fi
log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE \
$rebuild_blocks_min_l2size
}
log_onexit cleanup
# L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches
typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH)
typeset rebuild_blocks_min_l2size=$(get_tunable L2ARC_REBUILD_BLOCKS_MIN_L2SIZE)
log_must set_tunable32 L2ARC_NOPREFETCH 0
log_must set_tunable32 L2ARC_REBUILD_BLOCKS_MIN_L2SIZE 0
typeset fill_mb=800
typeset cache_sz=$(( floor($fill_mb / 2) ))
export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE
log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
typeset l2_dh_log_blk=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
log_must zpool online $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
log_must test $l2_dh_log_blk -eq $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk -gt 0
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
log_must zdb -lq $VDEV_CACHE
log_must zpool destroy -f $TESTPOOL
log_pass "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present."

View File

@ -1,143 +0,0 @@
#!/bin/ksh -p
#
# CDDL HEADER START
#
# 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.
#
# CDDL HEADER END
#
#
# Copyright (c) 2020, George Amanakis. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/l2arc/l2arc.cfg
#
# DESCRIPTION:
# Off/onlining an L2ARC device restores all written blocks, vdev present.
#
# STRATEGY:
# 1. Create pool with a cache device.
# 2. Create a random file in that pool and random read for 10 sec.
# 3. Read the amount of log blocks written from the header of the
# L2ARC device.
# 4. Offline the L2ARC device.
# 5. Online the L2ARC device.
# 6. Read the amount of log blocks rebuilt in arcstats and compare to
# (3).
# 7. Create another random file in that pool and random read for 10 sec.
# 8. Read the amount of log blocks written from the header of the
# L2ARC device.
# 9. Offline the L2ARC device.
# 10. Online the L2ARC device.
# 11. Read the amount of log blocks rebuilt in arcstats and compare to
# (8).
# 12. Check if the amount of log blocks on the cache device has
# increased.
# 13. Export the pool.
# 14. Read the amount of log blocks on the cache device.
# 15. Import the pool.
# 16. Read the amount of log blocks rebuilt in arcstats and compare to
# (14).
# 17. Check if the labels of the L2ARC device are intact.
#
verify_runnable "global"
log_assert "Off/onlining an L2ARC device restores all written blocks , vdev present."
function cleanup
{
if poolexists $TESTPOOL ; then
destroy_pool $TESTPOOL
fi
log_must set_tunable32 L2ARC_NOPREFETCH $noprefetch
}
log_onexit cleanup
# L2ARC_NOPREFETCH is set to 0 to let L2ARC handle prefetches
typeset noprefetch=$(get_tunable L2ARC_NOPREFETCH)
log_must set_tunable32 L2ARC_NOPREFETCH 0
typeset fill_mb=400
typeset cache_sz=$(( 3 * $fill_mb ))
export FILE_SIZE=$(( floor($fill_mb / $NUMJOBS) ))M
log_must truncate -s ${cache_sz}M $VDEV_CACHE
log_must zpool create -f $TESTPOOL $VDEV cache $VDEV_CACHE
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_dh_log_blk1=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
log_must zpool online $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
log_must test $l2_dh_log_blk1 -eq $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk1 -gt 0
log_must fio $FIO_SCRIPTS/mkfiles.fio
log_must fio $FIO_SCRIPTS/random_reads.fio
arcstat_quiescence_noecho l2_size
log_must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_dh_log_blk2=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
log_must zpool online $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
log_must test $l2_dh_log_blk2 -eq $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk2 -gt $l2_dh_log_blk1
log_must zpool export $TESTPOOL
arcstat_quiescence_noecho l2_feeds
typeset l2_dh_log_blk3=$(zdb -l $VDEV_CACHE | grep log_blk_count | \
awk '{print $2}')
typeset l2_rebuild_log_blk_start=$(get_arcstat l2_rebuild_log_blks)
log_must zpool import -d $VDIR $TESTPOOL
arcstat_quiescence_noecho l2_size
typeset l2_rebuild_log_blk_end=$(arcstat_quiescence_echo l2_rebuild_log_blks)
log_must test $l2_dh_log_blk3 -eq $(( $l2_rebuild_log_blk_end - \
$l2_rebuild_log_blk_start ))
log_must test $l2_dh_log_blk3 -gt 0
log must zpool offline $TESTPOOL $VDEV_CACHE
arcstat_quiescence_noecho l2_size
log_must zdb -lq $VDEV_CACHE
log_must zpool destroy -f $TESTPOOL
log_pass "Off/onlining an L2ARC device restores all written blocks, vdev present."

View File

@ -10,18 +10,18 @@
# #
# #
# Copyright (c) 2015, 2016 by Delphix. All rights reserved. # Copyright (c) 2015, 2021 by Delphix. All rights reserved.
# Copyright (c) 2016, Intel Corporation. # Copyright (c) 2016, Intel Corporation.
# #
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
# If neither is specified, do a nightly run. # Defaults common to all the tests in the regression group
[[ -z $PERF_REGRESSION_WEEKLY ]] && export PERF_REGRESSION_NIGHTLY=1 export PERF_RUNTIME=${PERF_RUNTIME:-'180'}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
# Default runtime for each type of test run. export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_RUNTIME_WEEKLY=$((30 * 60)) export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTIME_NIGHTLY=$((10 * 60)) export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
# Default to JSON for fio output # Default to JSON for fio output
export PERF_FIO_FORMAT=${PERF_FIO_FORMAT:-'json'} export PERF_FIO_FORMAT=${PERF_FIO_FORMAT:-'json'}
@ -90,8 +90,7 @@ function do_fio_run_impl
if $clear_cache; then if $clear_cache; then
# Clear the ARC # Clear the ARC
zpool export $PERFPOOL log_must zinject -a
zpool import $PERFPOOL
fi fi
if [[ -n $ZINJECT_DELAYS ]]; then if [[ -n $ZINJECT_DELAYS ]]; then
@ -159,8 +158,6 @@ function do_fio_run_impl
# set before launching zfstest to override the defaults. # set before launching zfstest to override the defaults.
# #
# PERF_RUNTIME: The time in seconds each fio invocation should run. # PERF_RUNTIME: The time in seconds each fio invocation should run.
# PERF_RUNTYPE: A human readable tag that appears in logs. The defaults are
# nightly and weekly.
# PERF_NTHREADS: A list of how many threads each fio invocation will use. # PERF_NTHREADS: A list of how many threads each fio invocation will use.
# PERF_SYNC_TYPES: Whether to use (O_SYNC) or not. 1 is sync IO, 0 is async IO. # PERF_SYNC_TYPES: Whether to use (O_SYNC) or not. 1 is sync IO, 0 is async IO.
# PERF_IOSIZES: A list of blocksizes in which each fio invocation will do IO. # PERF_IOSIZES: A list of blocksizes in which each fio invocation will do IO.
@ -424,22 +421,44 @@ function get_max_arc_size
echo $max_arc_size echo $max_arc_size
} }
function get_max_dbuf_cache_size function get_arc_target
{ {
typeset -l max_dbuf_cache_size typeset -l arc_c
if is_freebsd; then
arc_c=$(sysctl -n kstat.zfs.misc.arcstats.c)
elif is_illumos; then
arc_c=$(dtrace -qn 'BEGIN {
printf("%u\n", `arc_stats.arcstat_c.value.ui64);
exit(0);
}')
elif is_linux; then
arc_c=`awk '$1 == "c" { print $3 }' \
/proc/spl/kstat/zfs/arcstats`
fi
[[ $? -eq 0 ]] || log_fail "get_arc_target failed"
echo $arc_c
}
function get_dbuf_cache_size
{
typeset -l dbuf_cache_size dbuf_cache_shift
if is_illumos; then if is_illumos; then
max_dbuf_cache_size=$(dtrace -qn 'BEGIN { dbuf_cache_size=$(dtrace -qn 'BEGIN {
printf("%u\n", `dbuf_cache_max_bytes); printf("%u\n", `dbuf_cache_max_bytes);
exit(0); exit(0);
}') }')
else else
max_dbuf_cache_size=$(get_tunable DBUF_CACHE_MAX_BYTES) dbuf_cache_shift=$(get_tunable DBUF_CACHE_SHIFT)
dbuf_cache_size=$(($(get_arc_target) / 2**dbuf_cache_shift))
fi fi
[[ $? -eq 0 ]] || log_fail "get_max_dbuf_cache_size failed" [[ $? -eq 0 ]] || log_fail "get_dbuf_cache_size failed"
echo $max_dbuf_cache_size echo $dbuf_cache_size
} }
# Create a file with some information about how this system is configured. # Create a file with some information about how this system is configured.
@ -569,6 +588,14 @@ function pool_to_lun_list
echo $lun_list echo $lun_list
} }
function print_perf_settings
{
echo "PERF_NTHREADS: $PERF_NTHREADS"
echo "PERF_NTHREADS_PER_FS: $PERF_NTHREADS_PER_FS"
echo "PERF_SYNC_TYPES: $PERF_SYNC_TYPES"
echo "PERF_IOSIZES: $PERF_IOSIZES"
}
# Create a perf_data directory to hold performance statistics and # Create a perf_data directory to hold performance statistics and
# configuration information. # configuration information.
export PERF_DATA_DIR=$(get_perf_output_dir) export PERF_DATA_DIR=$(get_perf_output_dir)

View File

@ -12,7 +12,7 @@
# #
# #
# Copyright (c) 2015, 2020 by Delphix. All rights reserved. # Copyright (c) 2015, 2021 by Delphix. All rights reserved.
# #
# #
@ -55,28 +55,10 @@ populate_perf_filesystems
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
# Variables for use by fio. # Variables specific to this test for use by fio.
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'16 32'} export PERF_NTHREADS=${PERF_NTHREADS:-'16 32'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'} export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
fi
# Layout the files to be used by the read tests. Create as many files as the # Layout the files to be used by the read tests. Create as many files as the
# largest number of threads. An fio run with fewer threads will use a subset # largest number of threads. An fio run with fewer threads will use a subset
@ -109,6 +91,6 @@ else
) )
fi fi
log_note "Random reads with $PERF_RUNTYPE settings" log_note "Random reads with settings: $(print_perf_settings)"
do_fio_run random_reads.fio false true do_fio_run random_reads.fio false true
log_pass "Measure IO stats during random read load" log_pass "Measure IO stats during random read load"

View File

@ -12,7 +12,7 @@
# #
# #
# Copyright (c) 2015, 2020 by Delphix. All rights reserved. # Copyright (c) 2015, 2021 by Delphix. All rights reserved.
# #
# #
@ -55,28 +55,10 @@ populate_perf_filesystems
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
# Variables for use by fio. # Variables specific to this test for use by fio.
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'4 8 16 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
export PERF_IOSIZES='' # bssplit used instead
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'32 64'} export PERF_NTHREADS=${PERF_NTHREADS:-'32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'} export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES='' # bssplit used instead export PERF_IOSIZES='' # bssplit used instead
fi
# Layout the files to be used by the readwrite tests. Create as many files # Layout the files to be used by the readwrite tests. Create as many files
# as the largest number of threads. An fio run with fewer threads will use # as the largest number of threads. An fio run with fewer threads will use
@ -109,6 +91,6 @@ else
) )
fi fi
log_note "Random reads and writes with $PERF_RUNTYPE settings" log_note "Random reads and writes with settings: $(print_perf_settings)"
do_fio_run random_readwrite.fio false true do_fio_run random_readwrite.fio false true
log_pass "Measure IO stats during random read and write load" log_pass "Measure IO stats during random read and write load"

View File

@ -11,7 +11,7 @@
# #
# #
# Copyright (c) 2017, 2020 by Delphix. All rights reserved. # Copyright (c) 2017, 2021 by Delphix. All rights reserved.
# #
# #
@ -45,28 +45,10 @@ populate_perf_filesystems
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
# Variables for use by fio. # Variables specific to this test for use by fio.
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
export PERF_IOSIZES='8k 64k'
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'64 128'} export PERF_NTHREADS=${PERF_NTHREADS:-'64 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'} export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'} export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
export PERF_IOSIZES='8k'
fi
# Layout the files to be used by the readwrite tests. Create as many files # Layout the files to be used by the readwrite tests. Create as many files
# as the largest number of threads. An fio run with fewer threads will use # as the largest number of threads. An fio run with fewer threads will use
@ -101,6 +83,6 @@ else
) )
fi fi
log_note "Random reads and writes with $PERF_RUNTYPE settings" log_note "Random reads and writes with settings: $(print_perf_settings)"
do_fio_run random_readwrite_fixed.fio false true do_fio_run random_readwrite_fixed.fio false true
log_pass "Measure IO stats during random read and write load" log_pass "Measure IO stats during random read and write load"

View File

@ -12,7 +12,7 @@
# #
# #
# Copyright (c) 2015, 2020 by Delphix. All rights reserved. # Copyright (c) 2015, 2021 by Delphix. All rights reserved.
# #
# #
@ -54,28 +54,10 @@ populate_perf_filesystems
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
# Variables for use by fio. # Variables specific to this test for use by fio.
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 8 16 32 64 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 256k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'32 128'} export PERF_NTHREADS=${PERF_NTHREADS:-'32 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'} export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
fi
# Set up the scripts and output files that will log performance data. # Set up the scripts and output files that will log performance data.
lun_list=$(pool_to_lun_list $PERFPOOL) lun_list=$(pool_to_lun_list $PERFPOOL)
@ -100,6 +82,6 @@ else
) )
fi fi
log_note "Random writes with $PERF_RUNTYPE settings" log_note "Random writes with settings: $(print_perf_settings)"
do_fio_run random_writes.fio true false do_fio_run random_writes.fio true false
log_pass "Measure IO stats during random write load" log_pass "Measure IO stats during random write load"

View File

@ -12,7 +12,7 @@
# #
# #
# Copyright (c) 2015, 2020 by Delphix. All rights reserved. # Copyright (c) 2015, 2021 by Delphix. All rights reserved.
# #
. $STF_SUITE/include/libtest.shlib . $STF_SUITE/include/libtest.shlib
@ -43,28 +43,10 @@ recreate_perf_pool
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then # Variables specific to this test for use by fio.
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'1 2 4 8 16 32 64 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RANDSEED=${PERF_RANDSEED:-'1234'}
export PERF_COMPPERCENT=${PERF_COMPPERCENT:-'66'}
export PERF_COMPCHUNK=${PERF_COMPCHUNK:-'4096'}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 16 64'} export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 16 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'} export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
fi
# Until the performance tests over NFS can deal with multiple file systems, # Until the performance tests over NFS can deal with multiple file systems,
# force the use of only one file system when testing over NFS. # force the use of only one file system when testing over NFS.
@ -95,6 +77,7 @@ else
"dtrace -s $PERF_SCRIPTS/offcpu-profile.d" "offcpu-profile" "dtrace -s $PERF_SCRIPTS/offcpu-profile.d" "offcpu-profile"
) )
fi fi
log_note "ZIL specific random write workload with $PERF_RUNTYPE settings" log_note \
"ZIL specific random write workload with settings: $(print_perf_settings)"
do_fio_run random_writes.fio true false do_fio_run random_writes.fio true false
log_pass "Measure IO stats during ZIL specific random write workload" log_pass "Measure IO stats during ZIL specific random write workload"

Some files were not shown because too many files have changed in this diff Show More