Page MenuHomeFreeBSD

iflib: hold the CTX lock in iflib_pseudo_register

Authored by on Mar 15 2019, 11:53 PM.



The iflib_device_register function takes the CTX lock before calling
IFDI_ATTACH_PRE, and releases it upon finishing the registration.

Mirror this process in iflib_pseudo_register, so that we always hold the
CTX lock during the attach process when registering a pseudo interface
or a regular interface.

This was caught by code inspection while attempting to analyze where the
CTX lock was held.

Signed-off-by: Jacob Keller <>

Diff Detail

Lint OK
No Unit Test Coverage
Build Status
Buildable 23126
Build 22179: arc lint + arc unit

Event Timeline

erj accepted this revision as: erj.Mar 19 2019, 6:09 PM
erj added a subscriber: erj.

Anyone else have any feedback? It makes sense to me that the attach process for pseudo devices should use the context lock like the attach process for regular devices.

shurd accepted this revision.Mar 27 2019, 5:31 PM

Looks good to me.

This revision is now accepted and ready to land.Mar 27 2019, 5:31 PM
This revision was automatically updated to reflect the committed changes.