[SSI] openssi/kernel/cluster/ssi/cfs read.c,1.25,1.26

Roger Tsang <[email protected]> Mon, 17 Jan 2011 06:40:09 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28633/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	read.c 
Log Message:
(#ifdef CFS_CHARD_SYNC_FIX)
- cfs_readpage_result: when inserting into read_down list grab the inode reference before calling cfs_readdata_free() which does iput() on the inode. fix possible memory corruption since without holding the inode reference CFS failover can lose the race with invalidate_inodes(), prune_icache() or iput_final().
- cfs_restart_read: call iput() on the inode reference held by read_down list.


Index: read.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/read.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- read.c	25 Oct 2010 05:53:39 -0000	1.25
+++ read.c	17 Jan 2011 06:40:07 -0000	1.26
@@ -515,6 +515,7 @@
 #endif
 #ifdef CFS_CHARD_SYNC_FIX
 		if (list_empty(itoc_down(data->inode))) {
+			atomic_inc(&data->inode->i_count); /* for read_down */
 			list_add_tail(itoc_down(data->inode),
 					&CFS_SERVER(data->inode)->read_down);
 		}
@@ -930,9 +931,9 @@
 	list_for_each_entry_safe(cnode, tmp, &server->read_down, c_down_list) {
 		list_del_init(&cnode->c_down_list);
 		err = cfs_pagein_list(&cnode->c_read_down, server->rpages);
-		if (err < 0)
-			printk(KERN_ERR "%s: error %d\n",
-				__FUNCTION__, err);
+		if (unlikely(err < 0))
+			printk(KERN_ERR "%s: error %d\n", __FUNCTION__, err);
+		iput(ctoi(cnode)); /* held by read_down list */
 	}
 #else /* CFS_CHARD_SYNC_FIX */
 	if (!list_empty(&server->read_down)) {


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl