[SSI] openssi/kernel/cluster/ssi/vproc dvp_init.c, 1.13, 1.14 dvp_misc.c, 1.14, 1.15 reopen.c, 1.29, 1.30 rproc_svr_pproc.c, 1.23, 1.24

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

Modified Files:
      Tag: OPENSSI-FC
	dvp_init.c dvp_misc.c reopen.c rproc_svr_pproc.c 
Log Message:
CFS:
- Fix cfsd_create() possible dentry leak or operating on dereferenced dentry.
- Regression:
  - Possible orphan inodes after unmounting. (#ifdef RCU_CFSTOK_TABLE)

VPROC:
- VPROC_LOCATE_PID() further avoid global list lock; no longer support LVP_NOLOCK flag. (#ifdef VPROC_RCU_LIST)

 cfs/svrcfs.c            |    9 +++++----
 cfs/vfs.c               |    6 +++---
 vproc/dvp_init.c        |   26 +++++++++++++++++++++-----
 vproc/dvp_misc.c        |    2 ++
 vproc/reopen.c          |    4 +++-
 vproc/rproc_svr_pproc.c |    4 ++++
 6 files changed, 38 insertions(+), 13 deletions(-)


Index: reopen.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/reopen.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- reopen.c	3 Feb 2009 06:18:13 -0000	1.29
+++ reopen.c	12 Feb 2009 03:13:13 -0000	1.30
@@ -639,6 +639,7 @@
 						pathname, (int)ino);
 #endif
 		dput(nd->dentry);
+		mb(); /* need this? */
 		nd->dentry = dentry;
 		return 0;
 	}
@@ -841,8 +842,9 @@
 		SSI_ASSERT(*mntp);
 
 		dput(*dentryp);
-		*dentryp = NULL;
 		mntput(*mntp);
+		mb(); /* need this? */
+		*dentryp = NULL;
 		*mntp = NULL;
 	}
 	if (error)

Index: dvp_init.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/dvp_init.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dvp_init.c	9 Feb 2009 06:06:34 -0000	1.13
+++ dvp_init.c	12 Feb 2009 03:13:13 -0000	1.14
@@ -146,7 +146,9 @@
 	struct vproc *w;
 	int hashidx;
 #else
-#ifndef VPROC_RCU_LIST
+#ifdef VPROC_RCU_LIST
+	static DECLARE_MUTEX(mutex);
+#else
 	int exlock = 0;
 #endif
 #endif
@@ -158,7 +160,10 @@
 	if (pid < 0)
 		return NULL;
 
-#ifndef VPROC_RCU_LIST
+#ifdef VPROC_RCU_LIST
+	/* No longer support LVP_NOLOCK flag. We are lockless. */
+	BUG_ON(flags & LVP_NOLOCK);
+#else
 	if (!(flags & LVP_NOLOCK))
 		VPROC_LIST_LOCK();
 #endif
@@ -185,6 +190,9 @@
 			goto out;
 		}
 
+#ifdef VPROC_RCU_LIST
+		down(&mutex);
+#endif
 		/*
 		 * Since this is not the origin node of the pid, the process
 		 * could have migrated to a different node.  We create a vproc
@@ -192,19 +200,23 @@
 		 * a vproc in hand.
 		 */
 		if ((nvp = vproc_alloc()) == NULL) {
+#ifdef VPROC_RCU_LIST
+			up(&mutex);
+#endif
 			printk("locate_vproc_pid(): "
 			       "vproc_alloc() failure\n");
 			vp = NULL;
 			goto out;
 		}
 
+#ifndef VPROC_RCU_LIST
+		if (!(flags & LVP_NOLOCK))
+			VPROC_LIST_LOCK();
+#endif
 		/*
 		 * Make sure here that during the last vproc_alloc()
 		 * call, nobody has created a new vproc for this pid.
 		 */
-		if (!(flags & LVP_NOLOCK))
-			VPROC_LIST_LOCK();
-
 		vp = VPROCPTR_NOLOCK(pid);
 		if (vp == NULL) {
 			vp = nvp;
@@ -215,8 +227,10 @@
 			vp->vp_pid = pid;
 #ifdef VPROC_HASH_LIST
 #ifdef VPROC_RCU_LIST
+			VPROC_LIST_LOCK();
 			list_add_rcu(&vp->vp_list, &vproc_hash[VPROCPIDHASH(pid)]);
 			VPROC_HOLD(vp, str);
+			VPROC_LIST_UNLOCK();
 #else
 			list_add(&vp->vp_list, &vproc_hash[VPROCPIDHASH(pid)]);
 #ifdef VPROC_RELEASE__REFCNT_RACE_FIX
@@ -234,6 +248,8 @@
 			nvp = NULL;
 		}
 #ifdef VPROC_RCU_LIST
+		up(&mutex);
+#else
 		if (!(flags & LVP_NOLOCK))
 			VPROC_LIST_UNLOCK();
 #endif

Index: rproc_svr_pproc.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/rproc_svr_pproc.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- rproc_svr_pproc.c	3 Feb 2009 06:18:13 -0000	1.23
+++ rproc_svr_pproc.c	12 Feb 2009 03:13:13 -0000	1.24
@@ -291,6 +291,7 @@
 		read_lock(&current->fs->lock);
 		mntput(current->fs->rootmnt);
 		dput(current->fs->root);
+		mb(); /* need this? */
 		current->fs->rootmnt = rootmnt;
 		current->fs->root = root;
 		read_unlock(&current->fs->lock);
@@ -332,16 +333,19 @@
 	read_lock(&current->fs->lock);
 	mntput(current->fs->pwdmnt);
 	dput(current->fs->pwd);
+	mb(); /* need this? */
 	current->fs->pwdmnt = pwdmnt;
 	current->fs->pwd = pwd;
 	if (altroot) {
 		mntput(current->fs->altrootmnt);
 		dput(current->fs->altroot);
+		mb(); /* need this? */
 		current->fs->altrootmnt = altrootmnt;
 		current->fs->altroot = altroot;
 	}
 	mntput(current->fs->rootmnt);
 	dput(current->fs->root);
+	mb(); /* need this? */
 	current->fs->rootmnt = rootmnt;
 	current->fs->root = root;
 	current->fs->umask = comm_datap->comm_umask;

Index: dvp_misc.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/dvp_misc.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- dvp_misc.c	9 Feb 2009 05:00:36 -0000	1.14
+++ dvp_misc.c	12 Feb 2009 03:13:13 -0000	1.15
@@ -368,6 +368,7 @@
 	/* set the dentry and mnt ptrs for the executable name */
 	dput(PVP(current->p_vproc)->pvp_comm_de);
 	mntput(PVP(current->p_vproc)->pvp_comm_mnt);
+	mb(); /* need this? */
 	PVP(current->p_vproc)->pvp_comm_de = dget(f->f_dentry);
 	PVP(current->p_vproc)->pvp_comm_mnt = mntget(f->f_vfsmnt);
 }
@@ -384,6 +385,7 @@
 		dput(PVP(current->p_vproc)->pvp_comm_de);
 		mntput(PVP(current->p_vproc)->pvp_comm_mnt);
 	}
+	mb(); /* need this? */
 
 	PVP(current->p_vproc)->pvp_comm_de = NULL;
 	PVP(current->p_vproc)->pvp_comm_mnt = NULL;


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