Page MenuHomeFreeBSD

g_mirror_taste: avoid deadlock, always clear tasting flag
ClosedPublic

Authored by rlibby on Jun 24 2019, 4:33 PM.
Tags
None
Referenced Files
F136965079: D20744.id58956.diff
Thu, Nov 20, 8:50 PM
F136965047: D20744.id.diff
Thu, Nov 20, 8:50 PM
F136965008: D20744.id59295.diff
Thu, Nov 20, 8:50 PM
F136963259: D20744.diff
Thu, Nov 20, 8:42 PM
Unknown Object (File)
Mon, Nov 10, 5:37 AM
Unknown Object (File)
Tue, Oct 28, 9:34 AM
Unknown Object (File)
Oct 20 2025, 11:52 PM
Unknown Object (File)
Oct 20 2025, 11:52 PM
Subscribers

Details

Summary

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.

Sponsored by: Dell EMC Isilon

Test Plan

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

As a precaution I'd suggest running the tests under /usr/tests/sys/geom/class/mirror.

This revision is now accepted and ready to land.Jun 24 2019, 6:16 PM

As a precaution I'd suggest running the tests under /usr/tests/sys/geom/class/mirror.

Yes, I believe that is what the kyua line above does (and that's how I found this). Or does that run only a subset of tests?

As a precaution I'd suggest running the tests under /usr/tests/sys/geom/class/mirror.

Yes, I believe that is what the kyua line above does (and that's how I found this). Or does that run only a subset of tests?

Oops, I missed that. No, what you did should run all of the tests.