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, Jun 24, 5:10 AM
Unknown Object (File)
Mon, Jun 24, 5:03 AM
Unknown Object (File)
Dec 20 2023, 3:32 AM
Unknown Object (File)
Oct 28 2023, 5:44 PM
Unknown Object (File)
Sep 5 2023, 4:14 AM
Unknown Object (File)
Aug 11 2023, 2:54 AM
Unknown Object (File)
Aug 7 2023, 5:32 PM
Unknown Object (File)
Aug 7 2023, 5:31 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.