Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 May 2017 22:43:08 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r319263 - stable/10/cddl/contrib/opensolaris/cmd/zdb
Message-ID:  <201705302243.v4UMh8eb075617@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Tue May 30 22:43:08 2017
New Revision: 319263
URL: https://svnweb.freebsd.org/changeset/base/319263

Log:
  MFC r316856:
  
  MFV 316855
  
  7900 zdb shouldn't print the path of a znode at verbosity < 5
  
  Reviewed by: Paul Dagnelie <pcd@delphix.com>
  Reviewed by: Matt Ahrens <mahrens@delphix.com>
  Approved by: Dan McDonald <danmcd@omniti.com>
  Author: Alan Somers <asomers@freebsd.org>
  
  illumos/illumos-gate@e548d2fa41d1baa06662ed9abbb8bcec86e27dd9
  https://www.illumos.org/issues/7900
  
  Sponsored by:	Spectra Logic Corp

Modified:
  stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue May 30 22:41:19 2017	(r319262)
+++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue May 30 22:43:08 2017	(r319263)
@@ -1719,23 +1719,19 @@ dump_znode(objset_t *os, uint64_t object, void *data, 
 		return;
 	}
 
-	error = zfs_obj_to_path(os, object, path, sizeof (path));
-	if (error != 0) {
-		(void) snprintf(path, sizeof (path), "\?\?\?<object#%llu>",
-		    (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),
+			    "\?\?\?<object#%llu>", (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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705302243.v4UMh8eb075617>