summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2017-03-19 16:01:08 +0000
committertb <tb@openbsd.org>2017-03-19 16:01:08 +0000
commitbadee655110e43c9aa42ece1481889abf2f3caa1 (patch)
tree1ca38b4fe628aa2cb1e5642311091df2ec47c2a4
parenttweaks; ok florian (diff)
downloadwireguard-openbsd-badee655110e43c9aa42ece1481889abf2f3caa1.tar.xz
wireguard-openbsd-badee655110e43c9aa42ece1481889abf2f3caa1.zip
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
-rw-r--r--sys/dev/softraid.c5
1 files changed, 3 insertions, 2 deletions
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 <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -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));