HomeFreeBSD

geom_slice: fix r325227, protect against multiple calls to g_slice_free

Description

geom_slice: fix r325227, protect against multiple calls to g_slice_free

This geom does not immediately detach its consumer relying on the
wither-washer to do that. Since that happens asynchronously we may get
additional spoiling events. So, we need to account for that.

There are multiple options for fixing this issue like detaching
immediately or checking for G_CF_ORPHAN in g_slice_spoiled().
The most reliable and least intrusive fix seems to be setting
geom->softc to NULL on the first call and checking for NULL on
subsequent calls. This is something that the code did before r325227.

Reported by: David Wolfskill <david@catwhisker.org>,

		O. Hartmann <o.hartmann@walstatt.org>

Tested by: David Wolfskill <david@catwhisker.org> (earlier version)
Discussed with: mav
MFC after: 1 week
X-MFC with: r325227

Details

Provenance
avgAuthored on
Parents
rS325271: Use designated initializers for pmc sysent and module data.
Branches
Unknown
Tags
Unknown