Page MenuHomeFreeBSD

geli: fix a livelock during panic
ClosedPublic

Authored by asomers on May 5 2020, 2:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 30 2024, 1:40 AM
Unknown Object (File)
Sep 23 2024, 10:24 PM
Unknown Object (File)
Sep 20 2024, 5:45 AM
Unknown Object (File)
Sep 18 2024, 11:33 PM
Unknown Object (File)
Sep 16 2024, 8:24 PM
Unknown Object (File)
Sep 16 2024, 10:05 AM
Unknown Object (File)
Sep 6 2024, 6:22 PM
Unknown Object (File)
Sep 6 2024, 6:22 PM
Subscribers

Details

Summary

geli: fix a livelock during panic

During any kind of shutdown, kern_reboot calls geli's pre_sync event hook,
which tries to destroy all unused geli devices. But during a panic, geli
can't destroy any devices, because the scheduler is stopped, so it can't
switch threads. A livelock results, and the system never dumps core.

This commit fixes the problem by refusing to destroy any devices during
panic, used or otherwise.

PR: 246207
Sponsored By: Axcient

Test Plan

Manual testing as described in PR.

Diff Detail

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

Event Timeline

ping @jhb @pjd does this change look ok to you two?

jhb added inline comments.
sys/geom/eli/g_eli.c
1416 ↗(On Diff #71402)

kib@ would probably want you to do != 0 for all of those, but I'm fine with whatever pattern is normally used here in GEOM (e.g. should it be testing the sum != 0 instead of a bunch of ||?)

This revision is now accepted and ready to land.May 27 2020, 6:33 PM

Ok, I'll commit it kib's way. Checking the sum feels like a hack.

This revision was automatically updated to reflect the committed changes.