Page MenuHomeFreeBSD

iflib: allow clone detach if not yet init
ClosedPublic

Authored by kevans on Mar 9 2021, 12:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 1:17 PM
Unknown Object (File)
Mon, Dec 16, 1:16 AM
Unknown Object (File)
Tue, Dec 10, 3:30 PM
Unknown Object (File)
Nov 18 2024, 12:47 PM
Unknown Object (File)
Nov 15 2024, 9:35 PM
Unknown Object (File)
Nov 3 2024, 10:19 PM
Unknown Object (File)
Nov 3 2024, 10:19 PM
Unknown Object (File)
Nov 3 2024, 10:18 PM
Subscribers

Details

Summary

If we hit an error during init, then we'll unwind our state and attempt
to detach the device -- don't block it.

This was discovered by creating a wg0 with missing parameters; said
failure ended up leaving this orphaned device in place and ended up
panicking the system upon enumeration of the dev.* sysctl space.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This happens after an error from iflib_pseudo_register()?

This happens after an error from iflib_pseudo_register()?

Correct- the error path I was specifically seeing is iflib_clone_create() -> iflib_pseudo_register() -> IFDI_CLONEATTACH(); iflib_clone_create tries to delete the child but gets smacked with an EBUSY from this. I thought about setting IFC_IN_DETACH, but it's all barely-constructed at that point.

This happens after an error from iflib_pseudo_register()?

Correct- the error path I was specifically seeing is iflib_clone_create() -> iflib_pseudo_register() -> IFDI_CLONEATTACH(); iflib_clone_create tries to delete the child but gets smacked with an EBUSY from this. I thought about setting IFC_IN_DETACH, but it's all barely-constructed at that point.

Sure, I think this way is fine. Sorry for the breakage.

This revision is now accepted and ready to land.Mar 9 2021, 3:40 PM
This revision was automatically updated to reflect the committed changes.