diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2007-08-10 18:21:17 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-08-14 01:52:09 -0400 |
commit | d725fdc8027a4cd961f58d92917fbb91b171abfa (patch) | |
tree | 5e437314aa2f2c6e59705c4deb45e50959317099 /net | |
parent | b5890d8ba47741425fe3c0d753e1b57bc0561b7b (diff) |
[DCCP]: fix theoretical ccids_{read,write}_lock() race
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 <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dccp/ccid.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c index ccbf72c793b6..c45088b5e6fb 100644 --- a/net/dccp/ccid.c +++ b/net/dccp/ccid.c | |||
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(void) | |||
40 | static inline void ccids_read_lock(void) | 40 | static inline void ccids_read_lock(void) |
41 | { | 41 | { |
42 | atomic_inc(&ccids_lockct); | 42 | atomic_inc(&ccids_lockct); |
43 | smp_mb__after_atomic_inc(); | ||
43 | spin_unlock_wait(&ccids_lock); | 44 | spin_unlock_wait(&ccids_lock); |
44 | } | 45 | } |
45 | 46 | ||