[SSI] openssi/kernel/cluster/ssi/ipc rmtunix.c,1.24,1.25

Roger Tsang <[email protected]>
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/ipc
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16276/cluster/ssi/ipc

Modified Files:
      Tag: OPENSSI-FC
	rmtunix.c 
Log Message:
IPC:
- Regression:
  - rmtunix_socket_info structure lookup race. (#ifdef RCU_RMTUNIX_CACHE)
  - missing sock_hold() for rmtunix_cache_info(). (#ifdef IPC_STALE_RMTUNIX_CACHE_FIX)

 cluster/ssi/cfs/cfs_ipcshm.c     |    4 -
 cluster/ssi/cfs/svrcfs.c         |   37 +++++----------
 cluster/ssi/ipc/rmtunix.c        |   14 +----
 cluster/ssi/vproc/vp_subr.c      |    5 --
 include/cluster/ssi/ipc/unixnm.h |   93 ++++++++++++++++++++++++---------------
 include/cluster/ssi/unix.h       |   34 ++------------
 include/linux/config.h           |    5 +-
 7 files changed, 83 insertions(+), 109 deletions(-)


Index: rmtunix.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/ipc/rmtunix.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- rmtunix.c	7 Feb 2009 04:19:43 -0000	1.24
+++ rmtunix.c	8 Feb 2009 02:44:43 -0000	1.25
@@ -123,10 +123,10 @@
 			continue;
 		if (!atomic_dec_and_lock(&info->rsk_refcnt, &rmtunix_cache_listlock))
 			continue;
-#ifdef IPC_STALE_RMTUNIX_CACHE_FIX
 		if (info->sk) {
+			SSI_ASSERT(info->rsk_cached);
 			LOCK_SPIN_LOCK(&info->rsk_spinlock);
-			if (!info->rsk_cached) {
+			if (atomic_read(&info->rsk_refcnt)) {
 				UNLOCK_SPIN_LOCK(&info->rsk_spinlock);
 				spin_unlock(&rmtunix_cache_listlock);
 				continue;
@@ -135,7 +135,6 @@
 			UNLOCK_SPIN_LOCK(&info->rsk_spinlock);
 		} else
 			BUG_ON(info->rsk_cached);
-#endif
 #ifdef DEBUG
 		--rmtunix_cache_size;
 #endif
@@ -736,14 +735,7 @@
 	info->rmtid = rmtid;
 	info->magic = RMTUNIX_MAGIC;
 
-	/* Not sure why we call sock_hold(sk) when we already have sk.
-	 *		- Vladimir Razgulin
-	 */
-	/* RT: for _rmtunix_dealloc() */
-	if (!rmtunix_ismagic(sk))
-		sock_hold(sk);
-
-	unix_peer(sk) = (struct sock *)info;
+	set_mb(unix_peer(sk), (struct sock *)info);
 	rmtunix_cache_info(sk);
 
 	sk->sk_peercred = peercred;


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.