From badee655110e43c9aa42ece1481889abf2f3caa1 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 19 Mar 2017 16:01:08 +0000 Subject: Restore behavior from before r1.376: only set bv_percent if a rebuild is in progress. This eliminates the spurious and harmless "0% done" message in the output of 'bioctl softraid0' reported by various on misc. ok jsing --- sys/dev/softraid.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/softraid.c') diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 679162fbd22..fdde14be1df 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.377 2016/07/20 20:45:13 krw Exp $ */ +/* $OpenBSD: softraid.c,v 1.378 2017/03/19 16:01:08 tb Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -2616,7 +2616,8 @@ sr_ioctl_vol(struct sr_softc *sc, struct bioc_vol *bv) sd->mds.mdd_crypto.key_disk != NULL) bv->bv_nodisk++; #endif - bv->bv_percent = sr_rebuild_percent(sd); + if (bv->bv_status == BIOC_SVREBUILD) + bv->bv_percent = sr_rebuild_percent(sd); strlcpy(bv->bv_dev, sd->sd_meta->ssd_devname, sizeof(bv->bv_dev)); -- cgit v1.2.3-59-g8ed1b