[SSI] openssi/kernel/fs dcache.c, 1.8, 1.9 fifo.c, 1.5, 1.6 namei.c, 1.13, 1.14 namespace.c, 1.24, 1.25 pipe.c, 1.7, 1.8

Roger Tsang <[email protected]>
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/fs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1388/fs

Modified Files:
      Tag: OPENSSI-FC
	dcache.c fifo.c namei.c namespace.c pipe.c 
Log Message:
Multiple bug fixes. See ChangeLog.


Index: namespace.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/namespace.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- namespace.c	27 Oct 2009 03:18:30 -0000	1.24
+++ namespace.c	17 Dec 2009 06:43:51 -0000	1.25
@@ -531,13 +531,15 @@
 void
 mnt_remove_node(clusternode_t node)
 {
+	struct vfsmount *rootmnt, *mnt;
 	struct super_block *sb;		/* Super block being worked on. */
 	cfs_mntinfo_t *mip;	/* CFS mount information. */
-	struct vfsmount *rootmnt = current->fs->rootmnt;
-	struct namespace *n = current->namespace;
-	struct vfsmount *mnt;
 
-	down_write(&n->sem);
+	read_lock(&current->fs->lock);
+	rootmnt = mntget(current->fs->rootmnt);
+	read_unlock(&current->fs->lock);
+
+	down_write(&current->namespace->sem);
 	spin_lock(&vfsmount_lock);
 again:
 	for (mnt = rootmnt ; mnt ; mnt = next_mnt(mnt, rootmnt)) {
@@ -562,9 +564,10 @@
 				       __FUNCTION__);
 		}
 	}
-
 	spin_unlock(&vfsmount_lock);
-	up_write(&n->sem);
+	up_write(&current->namespace->sem);
+
+	mntput(rootmnt);
 }
 #endif /* CONFIG_CFS */
 
@@ -1438,7 +1441,8 @@
 	 * and mnt_remove_node() above.
 	 */
 	printk(KERN_WARNING "Private namespaces not supported yet!\n");
-	goto out;
+	put_namespace(namespace);
+	return -EPERM;
 #endif
 
 	if (!capable(CAP_SYS_ADMIN)) {

Index: pipe.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/pipe.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pipe.c	7 Aug 2007 03:06:13 -0000	1.7
+++ pipe.c	17 Dec 2009 06:43:51 -0000	1.8
@@ -656,6 +656,10 @@
 	}
 	if (info->tmp_page)
 		__free_page(info->tmp_page);
+#ifdef RMTFB_REFCNT_FIX
+	if (info->ssi_rmtfb_cli)
+		rmtfb_putcli((struct rmtfb_cli *)info->ssi_rmtfb_cli);
+#endif
 	kfree(info);
 }
 

Index: namei.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/namei.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- namei.c	27 Oct 2009 03:18:30 -0000	1.13
+++ namei.c	17 Dec 2009 06:43:51 -0000	1.14
@@ -300,6 +300,11 @@
 {
 	dput(nd->dentry);
 	mntput(nd->mnt);
+#ifdef CONFIG_SSI
+	/* XXX: double path_release() in __do_follow_link() path? */
+	nd->dentry = (void *) 0x00300300;
+	nd->mnt = (void *) 0x00300300;
+#endif
 }
 
 /*
@@ -1716,6 +1721,16 @@
 void dentry_unhash(struct dentry *dentry)
 {
 	dget(dentry);
+#ifdef KERNEL2616_53
+	//if (atomic_read(&dentry->d_count))
+		shrink_dcache_parent(dentry);
+	spin_lock(&dcache_lock);
+	spin_lock(&dentry->d_lock);
+	if (atomic_read(&dentry->d_count) == 2)
+		__d_drop(dentry);
+	spin_unlock(&dentry->d_lock);
+	spin_unlock(&dcache_lock);
+#else
 	spin_lock(&dcache_lock);
 	switch (atomic_read(&dentry->d_count)) {
 	default:
@@ -1728,6 +1743,7 @@
 		__d_drop(dentry);
 	}
 	spin_unlock(&dcache_lock);
+#endif /* !KERNEL2616_53 */
 }
 
 int vfs_rmdir(struct inode *dir, struct dentry *dentry)

Index: fifo.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/fifo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fifo.c	7 Aug 2007 03:06:13 -0000	1.5
+++ fifo.c	17 Dec 2009 06:43:51 -0000	1.6
@@ -38,7 +38,7 @@
 	int ret;
 
 #ifdef CONFIG_SSI
-/* SSI_XXX not used */
+/* SSI: used by ssi_fifo_register() macro */
 ssi_repeat:
 #endif
 	ret = -ERESTARTSYS;
@@ -52,6 +52,16 @@
 		ret = -ENOMEM;
 		if(!pipe_new(inode))
 			goto err_nocleanup;
+#ifdef CONFIG_SSI
+#ifdef RMTFB_REFCNT_FIX
+		{
+			struct pipe_inode_info *info = inode->i_pipe;
+			BUG_ON(info->ssi_rmtfb_cli);
+			info->ssi_rmtfb_cli = (void *) ftocli(filp);
+			/* ssi_fifo_register() already incremented rfb_refcnt */
+		}
+#endif /* RMTFB_REFCNT_FIX */
+#endif
 	}
 	filp->f_version = 0;
 

Index: dcache.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/fs/dcache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- dcache.c	27 Oct 2009 03:18:30 -0000	1.8
+++ dcache.c	17 Dec 2009 06:43:51 -0000	1.9
@@ -322,6 +322,10 @@
 struct dentry * d_find_alias(struct inode *inode)
 {
 	struct dentry *de;
+#ifdef KERNEL2616_53
+	if (list_empty(&inode->i_dentry))
+		return NULL;
+#endif
 	spin_lock(&dcache_lock);
 	de = __d_find_alias(inode, 0);
 	spin_unlock(&dcache_lock);
@@ -340,13 +344,22 @@
 	tmp = head;
 	while ((tmp = tmp->next) != head) {
 		struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
+#ifdef KERNEL2616_53
+		spin_lock(&dentry->d_lock);
+#endif
 		if (!atomic_read(&dentry->d_count)) {
 			__dget_locked(dentry);
 			__d_drop(dentry);
+#ifdef KERNEL2616_53
+			spin_unlock(&dentry->d_lock);
+#endif
 			spin_unlock(&dcache_lock);
 			dput(dentry);
 			goto restart;
 		}
+#ifdef KERNEL2616_53
+		spin_unlock(&dentry->d_lock);
+#endif
 	}
 	spin_unlock(&dcache_lock);
 }
@@ -873,6 +886,9 @@
 		dget_locked(alias);
 		spin_unlock(&dcache_lock);
 		BUG_ON(!d_unhashed(alias));
+#ifdef KERNEL2616_53
+		iput(inode);
+#endif
 		return alias;
 	}
 	list_add(&entry->d_alias, &inode->i_dentry);


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
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.