Fix devstat on md devices.
authorBruce Evans <bde@FreeBSD.org>
Sun, 9 Dec 2018 15:34:20 +0000 (15:34 +0000)
committerBruce Evans <bde@FreeBSD.org>
Sun, 9 Dec 2018 15:34:20 +0000 (15:34 +0000)
commitdac6a0d559271be959ba2fbf10693e1fce36a7c6
tree28371ffe6215310884b1cf74278e3187c33e2f69
parent25b4f9ad69e65a688f77df35062c81ac65a71f8d
Fix devstat on md devices.

devstat_end_transaction() was called before the i/o was actually ended
(by delivering it to GEOM), so at least the i/o length was messed up.
It was always recorded as 0, so the average transaction size and the
average transfer rate was always displayed as 0.

devstat_end_transaction() was not called at all for the error case, so
there were sometimes multiple starts per end.  I didn't observe this in
practice and don't know if it did much damage.  I think it extended the
length of the i/o to the next transaction.

Reviewed by: kib
sys/dev/md/md.c