Page MenuHomeFreeBSD

geli: fix a livelock during panic
ClosedPublic

Authored by asomers on May 5 2020, 2:51 PM.
Tags
None
Referenced Files
F137898673: D24697.id.diff
Thu, Nov 27, 12:33 AM
Unknown Object (File)
Tue, Nov 25, 5:01 AM
Unknown Object (File)
Sun, Nov 23, 11:59 AM
Unknown Object (File)
Fri, Nov 21, 12:36 AM
Unknown Object (File)
Fri, Nov 21, 12:31 AM
Unknown Object (File)
Fri, Nov 21, 12:31 AM
Unknown Object (File)
Fri, Nov 21, 12:28 AM
Unknown Object (File)
Thu, Nov 20, 12:05 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.