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)
Fri, Sep 20, 5:58 AM
Unknown Object (File)
Thu, Sep 19, 2:48 PM
Unknown Object (File)
Sun, Sep 8, 10:07 PM
Unknown Object (File)
Sep 4 2024, 8:50 PM
Unknown Object (File)
Sep 1 2024, 3:59 PM
Unknown Object (File)
Sep 1 2024, 3:41 AM
Unknown Object (File)
Aug 9 2024, 12:33 AM
Unknown Object (File)
Aug 8 2024, 4:14 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.