[SSI] openssi/kernel/cluster/ssi/vproc as_xscribe.c, 1.16, 1.17 dvp_move.c, 1.13, 1.14 nd_origin.c, 1.9, 1.10 procfs_subr.c, 1.13, 1.14 reopen.c, 1.30, 1.31 rproc_cli_pproc.c, 1.21, 1.22

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-serv23689/cluster/ssi/vproc

Modified Files:
      Tag: OPENSSI-FC
	as_xscribe.c dvp_move.c nd_origin.c procfs_subr.c reopen.c 
	rproc_cli_pproc.c 
Log Message:
CFS:
- Fix possible server token table hash key race with PFS file handle data.
- Further avoid ssi_get_super() to reduce contention. We don't cross mount points.
- Switch to Linux get_empty_filp() to get unused file structure for svrcfstok structure.
- Regression:
  - Possible inode leak when out of memory doing export ops get_dentry. (#ifdef CFS_EXPORT_OPS)
  - Possibly missed drop_super() while performing export ops get_dentry. (#ifdef CFS_FH_TO_DENTRY_ANON)

IPC:
- Fix uninitialized spin lock in kern_ipc_perm structure (in SSI context).
- Fix uninitialized linked list pointers in unixnm_svr_entry and unixnm_cache_entry structures.
- SHM dentry lookup bug fixes:
  - Error -ENOENT in CFS (negative dentry) due to not validating against PFS.
  - Fix SHM negative dentry lookup could cause future memory corruption.
    - Did not increment inode count when instantiating dentry.
    - Bad dentry reference count side-effect due to incorrect return value for Linux namespace architecture.

IPVS:
- Fix uninitialized linked list pointers in ipvs_dirinfo and portweight_list structures.

SSI:
- Fix dentry race calling __d_path() outside dcache lock. (#ifdef SSI_DCACHE_RACE_FIX)
- Fix uninitialized linked list pointers in structures rmtfb_cmn, ssidev_hash, fifonm_svr_entry, fifonm_cache_entry, and ssipty_svr_
entry.

VPROC:
- Fix possibly missed drop_super() during process migration exporting of file descriptors.
- Fix partially initialized proc_root_readdir_cookie structure.
- semundo_load_msg() handle process sysvsem.undo_list->proc_list race take two. (#ifdef VPROC_UNLOAD_SETSCHED_SMP)
- Regression:
  - Process migration traversing rmtfb path while importing SHM fd's; caused by fb_svrnode macro. (#ifdef REOP_EXPORT_PATH_SVRNODE)


Index: rproc_cli_pproc.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/rproc_cli_pproc.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- rproc_cli_pproc.c	3 Feb 2009 06:18:13 -0000	1.21
+++ rproc_cli_pproc.c	19 Feb 2009 08:01:02 -0000	1.22
@@ -201,7 +201,7 @@
 {
 	struct task_struct *t = current;
 	struct sem_undo *un;
-	int count = 0;
+	int count = 0, recount = 0;
 	int *undop;
 #ifdef VPROC_UNLOAD_SETSCHED_SMP
 	extern void lock_semundo(void);
@@ -215,6 +215,7 @@
 	}
 
 #ifdef VPROC_UNLOAD_SETSCHED_SMP
+retry:
 	lock_semundo();
 #endif
 	for (un = t->sysvsem.undo_list->proc_list; un; un = un->proc_next)
@@ -224,20 +225,34 @@
 #endif
 
 	semundop->semundolist_val =
-		kmalloc(count * sizeof(semundop->semundolist_val), GFP_USER);
+		kmalloc(count * sizeof(*semundop->semundolist_val), GFP_USER);
 	if (!semundop->semundolist_val)
 		return -ENOMEM;
+#ifndef VPROC_UNLOAD_SETSCHED_SMP
 	semundop->semundolist_len = count;
+#endif
 
 	undop = semundop->semundolist_val;
 
 #ifdef VPROC_UNLOAD_SETSCHED_SMP
 	lock_semundo();
 #endif
-	for (un = t->sysvsem.undo_list->proc_list; un; un = un->proc_next)
+	for (un = t->sysvsem.undo_list->proc_list; un; un = un->proc_next) {
+#ifdef VPROC_UNLOAD_SETSCHED_SMP
+		if (++recount > count)
+			break;
+#endif
 		*undop++ = un->semid;
+	}
 #ifdef VPROC_UNLOAD_SETSCHED_SMP
 	unlock_semundo();
+
+	if (unlikely(recount > count)) {
+		kfree((caddr_t)semundop->semundolist_val);
+		count = recount = 0;
+		goto retry;
+	}
+	semundop->semundolist_len = recount;
 #endif
 
 	return 0;

Index: nd_origin.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/nd_origin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- nd_origin.c	3 Feb 2009 06:18:13 -0000	1.9
+++ nd_origin.c	19 Feb 2009 08:01:02 -0000	1.10
@@ -227,10 +227,9 @@
 #ifdef VOD_HLIST
 	struct hlist_node *pos;
 #endif
+	int i;
 #ifdef RCU_VPROC_ORIGIN_LIST
 	extern void vproc_origin_dealloc(struct rcu_head *);
-#else
-	int i;
 #endif
 
 #ifdef ND_ORIGIN_DEADLOCK_FIX
@@ -335,17 +334,6 @@
 	UNLOCK_EXCL_RW_LOCK(&vproc_origin_deactivate_lock);
 #endif
 
-#ifdef RCU_VPROC_ORIGIN_LIST
-	call_rcu(&vodp->vod_rcu, vproc_origin_dealloc);
-}
-
-void
-vproc_origin_dealloc(struct rcu_head *vod_rcu)
-{
-	vproc_origin_data_t *vodp = container_of(vod_rcu, vproc_origin_data_t, vod_rcu);
-	int i;
-#endif
-
 	for (i=0; i < VPROC_CAREHASHSZ; i++)
 		vproc_carehead_list_release(vodp->vod_carehash[i]);
 
@@ -358,6 +346,17 @@
 	DEINIT_LOCK(&vodp->vod_carequeue_mutex);
 	DEINIT_COND_LOCK(&vodp->vod_response_mutex);
 	DEINIT_CONDITION(&vodp->vod_response_cond);
+
+#ifdef RCU_VPROC_ORIGIN_LIST
+	call_rcu(&vodp->vod_rcu, vproc_origin_dealloc);
+}
+
+void
+vproc_origin_dealloc(struct rcu_head *vod_rcu)
+{
+	vproc_origin_data_t *vodp =
+			container_of(vod_rcu, vproc_origin_data_t, vod_rcu);
+#endif
 	kfree((void *)vodp);
 }
 

Index: reopen.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/reopen.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- reopen.c	12 Feb 2009 03:13:13 -0000	1.30
+++ reopen.c	19 Feb 2009 08:01:02 -0000	1.31
@@ -448,7 +448,7 @@
 #endif
 
 	spin_lock(&dcache_lock);
-	path->parent_ino = dentry->d_parent->d_inode->i_ino;
+	path->parent_ino = parent_ino(dentry);
 	path->pathname = __d_path(dentry, mnt, NULL, NULL, path->pathpage,
 				  PAGE_SIZE);
 	spin_unlock(&dcache_lock);
@@ -456,6 +456,7 @@
 		error = PTR_ERR(path->pathname);
 		goto page_free_out;
 	}
+
 	if (is_shm_mmap(dentry, 0)) {
 		if ((path->svrnode = shm_get_svrnode(dentry)) ==
 		    CLUSTERNODE_INVAL) {
@@ -799,6 +800,7 @@
 					     path->fs_len,
 					     path->fs_fhtype,
 					     cfsd_acceptable, NULL);
+		drop_super(sb);
 #endif
 		if (IS_ERR(result))
 			error = PTR_ERR(result);
@@ -930,10 +932,9 @@
 	if (cli) {
 		SSI_ASSERT(!isreg);
 #ifdef REOP_EXPORT_PATH_SVRNODE
-		fb_datap->fb_svrnode = cli->rfb_server;
-#else
-		fb_datap->svrnode = cli->rfb_server;
+		fb_datap->path->svrnode = cli->rfb_server;
 #endif
+		fb_datap->fb_svrnode = cli->rfb_server;
 		fb_datap->fileid = cli->common.rfb_id;
 		rmtfb_putcli(cli);
 	}
@@ -944,10 +945,9 @@
 			goto free_out;
 		}
 #ifdef REOP_EXPORT_PATH_SVRNODE
-		fb_datap->fb_svrnode = this_node;
-#else
-		fb_datap->svrnode = this_node;
+		fb_datap->path->svrnode = this_node;
 #endif
+		fb_datap->fb_svrnode = this_node;
 		fb_datap->fileid = svr->common.rfb_id;
 		fb_datap->rfb = (char *) svr;
 	}
@@ -958,6 +958,7 @@
 		 */
 		fb_datap->pos = file->f_pos;
 		get_f_owner(file, &fb_datap->f_owner);
+		SSI_ASSERT(!fb_datap->fb_svrnode); /* shm */
 	}
 
 	fb_datap->ino = inode->i_ino;
@@ -1062,11 +1063,7 @@
 		fb_data	*fb_datap,
 		struct file **filep)
 {
-#ifdef REOP_EXPORT_PATH_SVRNODE
 	clusternode_t svrnode = fb_datap->fb_svrnode;
-#else
-	clusternode_t svrnode = fb_datap->svrnode;
-#endif
 	struct file *file = NULL;
 	int error;
 
@@ -1092,7 +1089,7 @@
 #ifdef SSI_SOCK_REOP_TYPE
 						,fb_datap->socket_type
 #elif !defined(REOP_EXPORT_PATH_SVRNODE)
-						,fb_datap->svrnode
+						,fb_datap->fb_svrnode
 #endif
 						);
 		error = PTR_ERR(cli);

Index: procfs_subr.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/procfs_subr.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- procfs_subr.c	9 Feb 2009 05:00:36 -0000	1.13
+++ procfs_subr.c	19 Feb 2009 08:01:02 -0000	1.14
@@ -31,11 +31,11 @@
 
 	if (PVP(current->p_vproc)->pvp_localview)
 		return 0;
-	cp = kmalloc(sizeof(struct proc_root_readdir_cookie), GFP_KERNEL);
+	cp = kzmalloc(sizeof(*cp), GFP_KERNEL);
 	if (cp == NULL)
 		return -ENOMEM;
-	cp->start_index = 0;
-	cp->cur_index = 0;
+	/* cp->start_index = 0; */
+	/* cp->cur_index = 0; */
 	file->private_data = cp;
 	return 0;
 }

Index: dvp_move.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/dvp_move.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dvp_move.c	3 Feb 2009 06:18:13 -0000	1.13
+++ dvp_move.c	19 Feb 2009 08:01:02 -0000	1.14
@@ -850,10 +850,10 @@
 		was_seen = d->m_seen;
 		mb();
 		d->m_seen = 1;
+		spin_unlock(&h->mh_lock);
+		goto already_done;
 	}
 	spin_unlock(&h->mh_lock);
-	if (d)
-		goto already_done;
 
 	d = alloc_move_data(h, pid, PM_NOTIFIED);
 	if (!d) {
@@ -868,7 +868,6 @@
 
 	d->m_seen = 1;
 	retval = 1;
-	p = PVP(v)->pvp_pproc;
 	spin_lock(&movement_list_lock);
 	if (p->execnode) {
 		spin_unlock(&movement_list_lock);

Index: as_xscribe.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/as_xscribe.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- as_xscribe.c	3 Feb 2009 06:18:13 -0000	1.16
+++ as_xscribe.c	19 Feb 2009 08:01:02 -0000	1.17
@@ -366,11 +366,29 @@
 		if (start >= eaddr)
 			break;
 		if (as_vma_is_file(vma)) {
+#ifdef SSI_DCACHE_RACE_FIX
+			struct vfsmount *rootmnt;
+			struct dentry *root;
+
+			read_lock(&p->fs->lock);
+			rootmnt = mntget(p->fs->rootmnt);
+			root = dget(p->fs->root);
+			read_unlock(&p->fs->lock);
+			spin_lock(&dcache_lock);
+			fname = __d_path(vma->vm_file->f_dentry,
+					 vma->vm_file->f_vfsmnt,
+					 root, rootmnt,
+					 asx_path, sizeof(asx_path));
+			spin_unlock(&dcache_lock);
+			dput(root);
+			mntput(rootmnt);
+#else
 			fname = __d_path(vma->vm_file->f_dentry,
 					 vma->vm_file->f_vfsmnt,
 					 p->fs->rootmnt->mnt_sb->s_root,
 					 p->fs->rootmnt,
 					 asx_path, sizeof(asx_path));
+#endif /* !SSI_DCACHE_RACE_FIX */
 		} else {
 			asx_path[0] = '\0';
 			fname = asx_path;


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
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.