HomeFreeBSD

A few locking fixes and cleanups to pfil hook registration,
rS186187Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

A few locking fixes and cleanups to pfil hook registration,
unregistration, and execution:

  • Add some brackets for clarity and trim a bit of vertical whitespace.
  • Remove comments that may not contribute to clarity, such as "Lock" before acquiring a lock and "Get memory" before allocating memory.
  • During hook registration, don't drop pfil_list_lock between checking for a duplicate and registering the hook, as this leaves a race condition by failing to enforce the "no duplicate hooks" invariant.
  • Don't lock the hook during registration, since it's not yet in use.
  • Document assumption that hooks will be quiesced before being unregistered.
  • Don't write-lock hooks during removal because they are assumed quiesced.
  • Rename "done" label to "locked_error" to be clear that it's an error path on the way out of hook execution.

MFC after: pretty soon

Details

Provenance
rwatsonAuthored on
Parents
rS186186: Fix locking in periph drivers - don't try to unlock periph
Branches
Unknown
Tags
Unknown

Event Timeline