Page MenuHomeFreeBSD

geli: fix a livelock during panic
ClosedPublic

Authored by asomers on May 5 2020, 2:51 PM.
Tags
None
Referenced Files
F93045888: D24697.id71402.diff
Fri, Sep 6, 6:22 PM
F93045860: D24697.id72337.diff
Fri, Sep 6, 6:22 PM
F93045852: D24697.id.diff
Fri, Sep 6, 6:22 PM
F93043958: D24697.diff
Fri, Sep 6, 6:11 PM
Unknown Object (File)
Wed, Sep 4, 1:15 PM
Unknown Object (File)
Sun, Sep 1, 8:51 PM
Unknown Object (File)
Sat, Aug 31, 12:46 PM
Unknown Object (File)
Aug 5 2024, 5:45 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.