[SSI] openssi/kernel/cluster/ssi/cfs svrcfs.c, 1.20, 1.21 vfs.c, 1.28, 1.29

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-serv23725/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	svrcfs.c vfs.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: svrcfs.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/svrcfs.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- svrcfs.c	8 Feb 2009 02:44:43 -0000	1.20
+++ svrcfs.c	12 Feb 2009 03:13:13 -0000	1.21
@@ -2716,19 +2716,20 @@
 					doagain = TRUE;
 					continue;
 				}
-				spin_lock(&svrcfstok_table_lock);
 				LOCK_COND_LOCK(&hp->sct_statelock);
 				if (atomic_read(&hp->sct_refcnt)) {
 					UNLOCK_COND_LOCK(&hp->sct_statelock);
-					spin_unlock(&svrcfstok_table_lock);
+					BUG_ON(atomic_read(&hp->sct_refcnt) < 0);
+					doagain = TRUE;
 					continue;
 				}
 				hp->sct_flags |= CFS_NOTREADY;
-				UNLOCK_COND_LOCK(&hp->sct_statelock);
-				hlist_del_rcu(&hp->sct_hlist);
 #ifdef DEBUG
 				hp->sct_magic = 0;
 #endif
+				UNLOCK_COND_LOCK(&hp->sct_statelock);
+				spin_lock(&svrcfstok_table_lock);
+				hlist_del_rcu(&hp->sct_hlist);
 				spin_unlock(&svrcfstok_table_lock);
 				list_add(&hp->sct_prlist, &tofree_head);
 			}

Index: vfs.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/vfs.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- vfs.c	3 Feb 2009 06:18:12 -0000	1.28
+++ vfs.c	12 Feb 2009 03:13:13 -0000	1.29
@@ -907,7 +907,7 @@
 cfsd_create(struct svrcfstok *dhp, struct qstr *name, int mode,
 		int type, dev_t rdev, int flags, struct svrcfstok **hpp)
 {
-	struct dentry	*dentry, *dchild;
+	struct dentry	*dentry, *dchild = NULL;
 	struct inode	*dirp;
 	int		err;
 	dev_t			dev = (dev_t)*(__u32 *)(&dhp->sct_fh);
@@ -971,7 +971,6 @@
 		}
 		err = 0;
 		*hpp = makehp(NULL, dev, dchild);
-		dput(dchild);
 		goto out_up;
 	}
 
@@ -1009,7 +1008,6 @@
 #endif
 
 	*hpp = makehp(NULL, dev, dchild);
-	dput(dchild);
 
 #ifdef CFS_ONLY_REMOTE_IS_CHARD
 	if (sbtocmi(dhp->sct_sb)->mi_flags & MI_CHARD && ssi_isremote())
@@ -1022,6 +1020,8 @@
 	}
 
 out_up:
+	if (!IS_ERR(dchild))
+		dput(dchild);
 	up(&dirp->i_sem);
 
 out:


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