netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 11/28] fix theoretical ccids_{read,write}_lock() race
@ 2007-08-10 21:11 akpm
  2007-08-10 22:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-08-10 21:11 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, oleg, acme, mingo

From: Oleg Nesterov <oleg@tv-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@tv-sign.ru>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-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);
 }
 
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 11/28] fix theoretical ccids_{read,write}_lock() race
  2007-08-10 21:11 [patch 11/28] fix theoretical ccids_{read,write}_lock() race akpm
@ 2007-08-10 22:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-08-10 22:21 UTC (permalink / raw)
  To: akpm; +Cc: netdev, oleg, acme, mingo

From: akpm@linux-foundation.org
Date: Fri, 10 Aug 2007 14:11:55 -0700

> From: Oleg Nesterov <oleg@tv-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@tv-sign.ru>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Applied to net-2.6, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-10 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-10 21:11 [patch 11/28] fix theoretical ccids_{read,write}_lock() race akpm
2007-08-10 22:21 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).