Date: Tue, 16 Dec 2008 17:03:22 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/net pfil.c Message-ID: <200812161703.mBGH3ZaY098719@repoman.freebsd.org>
index | next in thread | raw e-mail
rwatson 2008-12-16 17:03:22 UTC
FreeBSD src repository
Modified files:
sys/net pfil.c
Log:
SVN rev 186187 on 2008-12-16 17:03:22Z by rwatson
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
Revision Changes Path
1.16 +10 -32 src/sys/net/pfil.c
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812161703.mBGH3ZaY098719>
