fix theoretical ccids_{read,write}_lock() race
Subsystems (2)
PATCH 11/28 fix theoretical ccids_{read,write}_lock() race
From: Oleg Nesterov <[email protected]>
Make sure that spin_unlock_wait() is properly ordered wrt atomic_inc().
(akpm: can't we convert this code to use rwlocks?)
Signed-off-by Oleg Nesterov <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "David S. Miller" <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
net/dccp/ccid.c | 1 + 1 files changed, 1 insertion(+)
net/dccp/ccid.c renamed from net/dccp/ccid.c~fix-theoretical-ccids_readwrite_lock-race +1 -0
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(vostatic inline void ccids_read_lock (void ) {atomic_inc (&ccids_lockct); +smp_mb__after_atomic_inc ();spin_unlock_wait (&ccids_lock); }
_
From: [email protected]
Date: Fri, 10 Aug 2007 14:11:55 -0700
Quoted 11 lines
From: Oleg Nesterov <[email protected]>
Make sure that
spin_unlock_wait()is properly ordered wrtatomic_inc().(akpm: can't we convert this code to use rwlocks?)
Signed-off-by Oleg Nesterov <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Ingo Molnar <[email protected]>Cc "David S. Miller" <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Applied to net-2.6, thanks!