From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 5 07:50:01 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC110106566C for ; Fri, 5 Feb 2010 07:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B79A88FC1F for ; Fri, 5 Feb 2010 07:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o157o10b058299 for ; Fri, 5 Feb 2010 07:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o157o1G6058298; Fri, 5 Feb 2010 07:50:01 GMT (envelope-from gnats) Resent-Date: Fri, 5 Feb 2010 07:50:01 GMT Resent-Message-Id: <201002050750.o157o1G6058298@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rui DeSousa Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF597106568B for ; Fri, 5 Feb 2010 07:45:12 +0000 (UTC) (envelope-from rui@crazybean.net) Received: from que31.charter.net (que31.charter.net [209.225.8.23]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2E38FC0A for ; Fri, 5 Feb 2010 07:45:12 +0000 (UTC) Received: from imp09 ([10.20.200.9]) by mta11.charter.net (InterMail vM.7.09.02.04 201-2219-117-106-20090629) with ESMTP id <20100205070733.EVTS8038.mta11.charter.net@imp09> for ; Fri, 5 Feb 2010 02:07:33 -0500 Received: from mordor.crazybean.net ([24.151.31.171]) by imp09 with smtp.charter.net id e77U1d00J3hXYqY0577ZLs; Fri, 05 Feb 2010 02:07:33 -0500 Received: by mordor.crazybean.net (Postfix, from userid 1001) id 98D6810EA; Fri, 5 Feb 2010 02:05:43 -0500 (EST) Message-Id: <20100205070543.98D6810EA@mordor.crazybean.net> Date: Fri, 5 Feb 2010 02:05:43 -0500 (EST) From: Rui DeSousa To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/143572: The verbose output from iostat does not set the correct column width when multiple pools are displayed. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rui DeSousa List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 07:50:01 -0000 >Number: 143572 >Category: bin >Synopsis: The verbose output from iostat does not set the correct column width when multiple pools are displayed. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 05 07:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Rui DeSousa >Release: FreeBSD 8.0-RELEASE-p2 amd64 >Organization: >Environment: System: FreeBSD mordor.crazybean.net 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #1: Thu Jan 7 03:25:04 EST 2010 rui@mordor.crazybean.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The verbose output from iostat uses the last pool to set the max column width for cb_namewidth thus if prior pools use larger device names then the output is not aligned. The patch passes the cb_namewidth so that max_width returns the max name width of all pools. capacity operations bandwidth pool used avail read write read write --------------- ----- ----- ----- ----- ----- ----- . . . gpt/hydra6 - - 0 5 2.88K 329K gpt/hydra7 - - 0 5 2.77K 329K mirror 628K 1.98G 0 20 0 2.51M gpt/hydra_zil0 - - 0 20 34 2.51M gpt/hydra_zil1 - - 0 20 34 2.51M cache - - - - - - gpt/hydra_cache0 8.06G 19.8G 0 2 3.37K 259K gpt/hydra_cache1 8.12G 19.7G 0 2 6.21K 261K --------------- ----- ----- ----- ----- ----- ----- system 5.86G 26.1G 1 14 11.0K 208K mirror 5.86G 26.1G 1 14 11.0K 208K gpt/system0 - - 0 9 8.26K 208K gpt/system1 - - 0 9 8.02K 208K --------------- ----- ----- ----- ----- ----- ----- >How-To-Repeat: 1. Create two ZFS pools with the first pool having larger device names. 2. zpool iostat -v >Fix: --- zpool_main.c.patch begins here --- --- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c 2008-11-17 15:49:29.000000000 -0500 +++ cddl/contrib/opensolaris/cmd/zpool/zpool_main.c.rui 2010-02-05 01:18:27.780612396 -0500 @@ -1838,7 +1838,7 @@ if (!cb->cb_verbose) cb->cb_namewidth = strlen(zpool_get_name(zhp)); else - cb->cb_namewidth = max_width(zhp, nvroot, 0, 0); + cb->cb_namewidth = max_width(zhp, nvroot, 0, cb->cb_namewidth); } /* --- zpool_main.c.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: