Use buf to send speedup
authorimp <imp@FreeBSD.org>
Fri, 17 Jan 2020 01:16:19 +0000 (01:16 +0000)
committerimp <imp@FreeBSD.org>
Fri, 17 Jan 2020 01:16:19 +0000 (01:16 +0000)
commit82ef2aef29f614fc0a46decc92f8170caf7751de
tree2e1ab29a59d344f9bffe1af2b149bbc041298dde
parent4aee421586df0608167b8a6d4304cade5910497d
Use buf to send speedup

It turns out there's a problem with using g_io to send the speedup. It leads to
a race when there's a resource shortage when a disk fails.

Instead, send BIO_SPEEDUP via struct buf. This is pretty straight forward,
except we need to transfer the bio_flags from b_ioflags for BIO_SPEEDUP commands
in g_vfs_strategy.

Reviewed by: kirk, chs
Differential Revision: https://reviews.freebsd.org/D23117
sys/geom/geom_vfs.c
sys/ufs/ffs/ffs_softdep.c