Skip to content

Commit

Permalink
[DCCP]: fix theoretical ccids_{read,write}_lock() race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov authored and David S. Miller committed Aug 14, 2007
1 parent b5890d8 commit d725fdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/dccp/ccid.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static inline void ccids_write_unlock(void)
static inline void ccids_read_lock(void)
{
atomic_inc(&ccids_lockct);
smp_mb__after_atomic_inc();
spin_unlock_wait(&ccids_lock);
}

Expand Down

0 comments on commit d725fdc

Please sign in to comment.