diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-08-28 20:06:02 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-08-28 20:06:02 +0000 |
commit | 464ba339f01ef15c3bef8d990c268431fe769b42 (patch) | |
tree | 09f788d8608445b924626fff925bd963c42f6a0b /sys/contrib | |
parent | bc1de82641d5a9be69feee477bff716e1f245aa8 (diff) | |
download | FreeBSD-src-464ba339f01ef15c3bef8d990c268431fe769b42.zip FreeBSD-src-464ba339f01ef15c3bef8d990c268431fe769b42.tar.gz |
Merge r196481 from head to stable/8:
Rework global locks for interface list and index management, correcting
several critical bugs, including race conditions and lock order issues:
Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an
sxlock. Either can be held to stablize the lists and indexes, but both
are required to write. This allows the list to be held stable in both
network interrupt contexts and sleepable user threads across sleeping
memory allocations or device driver interactions. As before, writes to
the interface list must occur from sleepable contexts.
Reviewed by: bz, julian
Approved by: re (kib)
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/altq/altq/altq_subr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c index 32107e5..edacc0d 100644 --- a/sys/contrib/altq/altq/altq_subr.c +++ b/sys/contrib/altq/altq/altq_subr.c @@ -462,8 +462,8 @@ tbr_timeout(arg) s = splimp(); #endif #if defined(__FreeBSD__) && (__FreeBSD_version >= 500000) - IFNET_RLOCK(); - VNET_LIST_RLOCK(); + IFNET_RLOCK_NOSLEEP(); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); #endif @@ -480,8 +480,8 @@ tbr_timeout(arg) #if defined(__FreeBSD__) && (__FreeBSD_version >= 500000) CURVNET_RESTORE(); } - VNET_LIST_RUNLOCK(); - IFNET_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); + IFNET_RUNLOCK_NOSLEEP(); #endif splx(s); if (active > 0) |