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
Unknown Object (File)
Mon, Nov 10, 5:37 AM
Unknown Object (File)
Tue, Oct 28, 9:34 AM
Unknown Object (File)
Mon, Oct 20, 11:52 PM
Unknown Object (File)
Mon, Oct 20, 11:52 PM
Unknown Object (File)
Mon, Oct 20, 11:52 PM
Unknown Object (File)
Mon, Oct 20, 1:53 PM
Unknown Object (File)
Sun, Oct 19, 11:22 PM
Unknown Object (File)
Oct 13 2025, 7:35 AM
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.