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.
This commit is contained in:
parent
7234ef453b
commit
8de799ea3a
@ -2776,7 +2776,8 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t *vs)
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user