changeset 2984:4cbdbc401db9

4970570 fsdb_ufs ":log_head" prints extent list twice 5031435 fsdb dumps a core with :log_otodb command Contributed by Shawn Walker <binarycrusader@gmail.com>
author dmick
date Thu, 26 Oct 2006 12:33:58 -0700
parents 50a8637dc64d
children 78b075f897aa
files usr/src/cmd/fs.d/ufs/fsdb/fsdb.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c	Thu Oct 26 09:03:00 2006 -0700
+++ b/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c	Thu Oct 26 12:33:58 2006 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -5074,10 +5074,6 @@
 		printf("\t  [%d] lbno 0x%08x pbno 0x%08x nbno 0x%08x\n",
 		    x, log_eb->extents[x].lbno, log_eb->extents[x].pbno,
 		    log_eb->extents[x].nbno);
-	for (x = 0; x < log_eb->nextents; x++)
-		printf("\t  [%d] lbno 0x%08x pbno 0x%08x nbno 0x%08x\n",
-		    x, log_eb->extents[x].lbno, log_eb->extents[x].pbno,
-		    log_eb->extents[x].nbno);
 	printf("\nOn Disk Info\n\tbol_lof    : 0x%08x\n\teol_lof    : 0x%08x\n",
 	    log_odi->od_bol_lof, log_odi->od_eol_lof);
 	printf("\tlog_size   : 0x%08x\n",
@@ -5105,6 +5101,13 @@
 	uint32_t	lblk = (uint32_t)btodb(off);
 	int	x;
 
+	if (!log_get_header_info())
+		/*
+		 * No need to display anything here. The previous routine
+		 * has already done so.
+		 */
+		return;
+
 	for (x = 0; x < log_eb->nextents; x++)
 		if ((lblk >= log_eb->extents[x].lbno) &&
 		    (lblk < (log_eb->extents[x].lbno +