From 4691f326d00984c2fc2b9dba000577751b9b0497 Mon Sep 17 00:00:00 2001 From: asomers Date: Tue, 30 May 2017 22:43:08 +0000 Subject: [PATCH] MFC r316856: MFV 316855 7900 zdb shouldn't print the path of a znode at verbosity < 5 Reviewed by: Paul Dagnelie Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Alan Somers illumos/illumos-gate@e548d2fa41d1baa06662ed9abbb8bcec86e27dd9 https://www.illumos.org/issues/7900 Sponsored by: Spectra Logic Corp git-svn-id: svn://svn.freebsd.org/base/stable/10@319263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index d3c42693d..c0b7cdce5 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -1719,23 +1719,19 @@ dump_znode(objset_t *os, uint64_t object, void *data, size_t size) return; } - error = zfs_obj_to_path(os, object, path, sizeof (path)); - if (error != 0) { - (void) snprintf(path, sizeof (path), "\?\?\?", - (u_longlong_t)object); - } - if (dump_opt['d'] < 3) { - (void) printf("\t%s\n", path); - (void) sa_handle_destroy(hdl); - return; - } - z_crtime = (time_t)crtm[0]; z_atime = (time_t)acctm[0]; z_mtime = (time_t)modtm[0]; z_ctime = (time_t)chgtm[0]; - (void) printf("\tpath %s\n", path); + if (dump_opt['d'] > 4) { + error = zfs_obj_to_path(os, object, path, sizeof (path)); + if (error != 0) { + (void) snprintf(path, sizeof (path), + "\?\?\?", (u_longlong_t)object); + } + (void) printf("\tpath %s\n", path); + } dump_uidgid(os, uid, gid); (void) printf("\tatime %s", ctime(&z_atime)); (void) printf("\tmtime %s", ctime(&z_mtime)); -- 2.45.0