[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200708102111.l7ALBteq009403@imap1.linux-foundation.org>
Date: Fri, 10 Aug 2007 14:11:55 -0700
From: akpm@...ux-foundation.org
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, akpm@...ux-foundation.org, oleg@...sign.ru,
acme@...hat.com, mingo@...e.hu
Subject: [patch 11/28] fix theoretical ccids_{read,write}_lock() race
From: Oleg Nesterov <oleg@...sign.ru>
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@...sign.ru>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: "David S. Miller" <davem@...emloft.net>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
net/dccp/ccid.c | 1 +
1 files changed, 1 insertion(+)
diff -puN net/dccp/ccid.c~fix-theoretical-ccids_readwrite_lock-race net/dccp/ccid.c
--- a/net/dccp/ccid.c~fix-theoretical-ccids_readwrite_lock-race
+++ a/net/dccp/ccid.c
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(vo
static inline void ccids_read_lock(void)
{
atomic_inc(&ccids_lockct);
+ smp_mb__after_atomic_inc();
spin_unlock_wait(&ccids_lock);
}
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists