[SSI] openssi/kernel/cluster/ssi/cfs cfs_ipcshm.c, 1.18, 1.19 svrcfs.c, 1.19, 1.20

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

Modified Files:
      Tag: OPENSSI-FC
	cfs_ipcshm.c svrcfs.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: cfs_ipcshm.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/cfs_ipcshm.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cfs_ipcshm.c	7 Feb 2009 04:19:43 -0000	1.18
+++ cfs_ipcshm.c	8 Feb 2009 02:44:41 -0000	1.19
@@ -96,10 +96,6 @@
 	svr_shm->shm_svr =(struct svrcfstok *)makehp(cfs_shm_sb,
 			ssidev_get_s_ssidev(shm_mnt->mnt_sb, FALSE),de);
 	SSI_ASSERT(svr_shm->shm_svr);
-#ifdef CFS_IPCSHM_DENTRY
-	if (!svr_shm->shm_svr->sct_dp)
-		svr_shm->shm_svr->sct_dp = dget(de);
-#endif
 	if (shm_svr_addid(svr_shm) < 0) {
 		printk("failed to add shm svr\n");
 		HASH_RELE(svr_shm->shm_svr);

Index: svrcfs.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/svrcfs.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- svrcfs.c	7 Feb 2009 04:19:43 -0000	1.19
+++ svrcfs.c	8 Feb 2009 02:44:43 -0000	1.20
@@ -357,10 +357,9 @@
 		WARN_ON(sem_owned(&dentry->d_inode->i_sem));
 		down(&dentry->d_inode->i_sem);
 
-		/* Negative lookup */
 		hp = hfind(fhp);
 		if (hp) {
-			/* Lost the race */
+			/* Token created while we waited on semaphore */
 			up(&dentry->d_inode->i_sem);
 			break;
 		}
@@ -443,21 +442,16 @@
 		if (mount_sb) {
 			hp->sct_sb = mount_sb;
 		} else {
-		 	struct super_block *sb;
-
-			sb = ssi_get_super(((__u32 *)fhp)[0]);
-			if (sb == NULL)
+			hp->sct_sb = ssi_get_super(((__u32 *)fhp)[0]);
+			if (!hp->sct_sb)
 				panic("svrtok_lookup: Can't find SB\n");
 
 #ifdef SSI_CFS_SKIP
 			/* Track active svrcfstok structures per SB. */
-			INCR_ATOMIC_INT(&sbtocmi(sb)->mi_svrcfstoks);
+			INCR_ATOMIC_INT(&sbtocmi(hp->sct_sb)->mi_svrcfstoks);
 #endif
-
-			hp->sct_sb = sb;
-
 			/* Release super reference */
-			drop_super(sb);
+			drop_super(hp->sct_sb);
 		}
 
 #ifdef SSI_CFS_NOTYET
@@ -507,18 +501,17 @@
 		 * list for potential dentry to use. Or create a disconnected
 		 * one if neccesary.
 		 */
-#ifdef SSI_SKIP
+#ifndef RCU_CFSTOK_TABLE
 		SSI_ASSERT(atomic_read(&dentry->d_count));
 		atomic_inc(&dentry->d_count);
 		hp->sct_dp = dentry;
-#else
-		hp->sct_dp = dget(dentry);
 #endif
 
-#ifdef SSI_SKIP
+#ifdef RCU_CFSTOK_TABLE
 		hp->sct_ip = igrab(dentry->d_inode);
 		BUG_ON(hp->sct_ip == NULL);
-		/* hp->sct_dp = d_find_alias(dentry->d_inode); */
+
+		hp->sct_dp = dget(dentry);
 #else
 		/* Keep inode if need a different dentry (based on __iget() */
 		SSI_ASSERT(atomic_read(&(dentry->d_inode->i_count)));
@@ -583,10 +576,7 @@
 	cfhandle_t fh;
 	int error;
 
-	if (pdentry == NULL)
-		return NULL;
-
-	if (pdentry->d_inode == NULL)
+	if (!pdentry || !pdentry->d_inode)
 		return NULL;
 
 	/* Build file handle based on PFS inode */
@@ -602,10 +592,7 @@
 svrtok_relse(struct svrcfstok *hp)
 {
 #ifdef RCU_CFSTOK_TABLE
-	BUG_ON(atomic_read(&hp->sct_refcnt) < 1);
-
-	if (atomic_read(&hp->sct_refcnt) == 1)
-		might_sleep();
+	might_sleep_if(atomic_read(&hp->sct_refcnt) == 1);
 	if (!atomic_dec_and_lock(&hp->sct_refcnt, &svrcfstok_table_lock))
 		return;
 	LOCK_COND_LOCK(&hp->sct_statelock);
@@ -2939,8 +2926,8 @@
 
 		if (filp->f_op && filp->f_op->release)
 			filp->f_op->release(hp->sct_ip, filp);
-		fops_put(filp->f_op);
 		dput(filp->f_dentry);
+		fops_put(filp->f_op);
 		kfree(filp);
 	}
 


------------------------------------------------------------------------------
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.