]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix aggregating geoms for BIO_SPEEDUP.
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 27 Jan 2020 13:15:16 +0000 (13:15 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 27 Jan 2020 13:15:16 +0000 (13:15 +0000)
commitfd99699d7ef13a361f452c6c339302f6919ffcb0
treea952ee84dfdb8c580ea6c49f1c797da1c713120e
parentd2c32def56f4952cb283ac70fa4be787c6a5eb4b
Fix aggregating geoms for BIO_SPEEDUP.

If the bio was split into several bios going down, completion computes
bio_completed of the original bio as sum of the bio_completes of the
splits.  For BIO_SETUP, bio_length means something different than the
length. it is the requested speedup amount, and is duplicated into the
splits, which is in fact reasonable, since we cannot know how the
previous activity was distributed among subordinate geoms.  Obviously,
the sum of n bio_length is greater than bio_length for n > 1, which
triggers assert that bio_length >= bio_completed for e.g. geom_stripe
and geom_raid3.

Fix this by reassigning bio_completed from bio_length for completed
BIO_SPEEDED, I do not think it really mattters what we return in
bio_completed.

Reported and tested by: pho
Reviewed by: imp
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23380
sys/geom/geom_subr.c
sys/geom/stripe/g_stripe.c