summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2015-07-29 23:11:32 -0500
committerBrian Behlendorf <[email protected]>2015-07-30 14:34:09 -0700
commit6bec4351f5877f3f20dc9d7730aba7b1df983ecd (patch)
tree7100d0e6c56a11e1ac6b5e3cbac8bc73038a7a33 /cmd
parent69520d6855d962885e9ec4e2614575bb39c6326b (diff)
ztest: display non-index properties properly at verbose level 6
At verbosity levels of 6 or greater, ztest_dsl_prop_set_uint64() attempts to display the value of all properties as indexed values regardless of whether the property is an indexed value or simply an un-indexed integer. This patch causes the numeric value of the property to be displayed if zfs_prop_index_to_string() fails. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3649
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ztest/ztest.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 642cab5f2..f2ffcaf3e 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -1097,9 +1097,16 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
VERIFY0(dsl_prop_get_integer(osname, propname, &curval, setpoint));
if (ztest_opts.zo_verbose >= 6) {
- VERIFY(zfs_prop_index_to_string(prop, curval, &valname) == 0);
- (void) printf("%s %s = %s at '%s'\n",
- osname, propname, valname, setpoint);
+ int err;
+
+ err = zfs_prop_index_to_string(prop, curval, &valname);
+ if (err)
+ (void) printf("%s %s = %llu at '%s'\n",
+ osname, propname, (unsigned long long)curval,
+ setpoint);
+ else
+ (void) printf("%s %s = %s at '%s'\n",
+ osname, propname, valname, setpoint);
}
umem_free(setpoint, MAXPATHLEN);