HomeFreeBSD

g_mirror_taste: avoid deadlock, always clear tasting flag

Description

g_mirror_taste: avoid deadlock, always clear tasting flag

If g_mirror_taste encountered an error at g_mirror_add_disk, it might
try to g_mirror_destroy the device with the G_MIRROR_DEVICE_FLAG_TASTING
flag still set. This would wait on a worker to complete the destruction
with g_mirror_try_destroy, but that function bails out if the tasting
flag is set, resulting in a deadlock. Clear the tasting flag before
trying to destroy the device.

Test Plan:
sysctl debug.fail_point.mnowait="1%return"
kyua test -k /usr/tests/sys/geom/class/mirror/Kyuafile

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20744

Details

Provenance
rlibbyAuthored on
Reviewer
markj
Differential Revision
D20744: g_mirror_taste: avoid deadlock, always clear tasting flag
Parents
rS349586: g_eli_create: only dec g_access acw if we inc'd it
Branches
Unknown
Tags
Unknown