Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Dec 2014 04:54:49 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276450 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201412310454.sBV4snQh003921@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Wed Dec 31 04:54:48 2014
New Revision: 276450
URL: https://svnweb.freebsd.org/changeset/base/276450

Log:
  Correct zpool list displaying invalid EXPANDSZ for unavailable pool vdevs
  
  When pools are unavailable their vdevs are also unavailable which means
  that vdev_max_asize remains at the default zero. This default was being
  used to calculate vs_esize resulting in a negative number as vdev_asize >
  vdev_max_asize, which caused zpool list -v to display 16.0E for EXPANDSZ
  of these vdevs.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Dec 31 04:52:32 2014	(r276449)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Dec 31 04:54:48 2014	(r276450)
@@ -2776,7 +2776,8 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t *
 	vs->vs_rsize = vdev_get_min_asize(vd);
 	if (vd->vdev_ops->vdev_op_leaf)
 		vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE;
-	vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize;
+	if (vd->vdev_max_asize != 0)
+		vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize;
 	vs->vs_configured_ashift = vd->vdev_top != NULL
 	    ? vd->vdev_top->vdev_ashift : vd->vdev_ashift;
 	vs->vs_logical_ashift = vd->vdev_logical_ashift;



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