[1636] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

(fwd) Linux patch to fs/inode.c, mark #3

daemon@ATHENA.MIT.EDU (Derek Atkins)
Mon Mar 31 14:34:23 1997

To: linux-dev@MIT.EDU
From: Derek Atkins <warlord@MIT.EDU>
Date: 31 Mar 1997 14:34:07 -0500

I spent a while with Ted today trying to track down the Linux-AFS
cache corruption..  We went through the AFS cache code, and he seemed
to think that there wasn't much of a problem.  Under a system that is
heavily loaded, he thinks that there is a race condition in the Linux
kernel where it is possible for two opened files to get the same inode
structure.

He doesn't know if this patch will fix the AFS Cache Corruption, but
I'm looking for people to try this out.

This patch is against 2.0.29, but it should patch cleanly against most
2.0.x and 2.1.x kernels.  If you rebuild your kernel with the patch,
please be sure to remove any hacks where you remove the AFS Cache on
reboot.  Please let me know if you try this patch.  Also, please let
me know if you have any cache corruption while running with this
patch.

Thanks!

-derek

PS: Unless I hear any objections, I'm probably going to apply this
patch on CJ and build a new kernel there.

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/      PP-ASEL      N1NWH
       warlord@MIT.EDU                        PGP key available
------- Start of forwarded message -------
Date: Mon, 31 Mar 1997 12:47:06 -0500
Message-Id: <199703311747.MAA00296@rsts-11.mit.edu>
To: warlord@MIT.EDU
Subject: Linux patch to fs/linux.c, mark #3
From: tytso@MIT.EDU


--- fs/inode.c	1997/03/31 17:05:03	1.1
+++ fs/inode.c	1997/03/31 17:43:28
@@ -173,8 +173,8 @@
 {
 	struct wait_queue * wait;
 
-	truncate_inode_pages(inode, 0);
 	wait_on_inode(inode);
+	truncate_inode_pages(inode, 0);
 	if (IS_WRITABLE(inode)) {
 		if (inode->i_sb && inode->i_sb->dq_op)
 			inode->i_sb->dq_op->drop(inode);
@@ -512,6 +512,7 @@
 		sleep_on(&inode_wait);
 		goto repeat;
 	}
+found_good:
 	if (best->i_lock) {
 		wait_on_inode(best);
 		goto repeat;
@@ -522,7 +523,7 @@
 	}
 	if (best->i_count)
 		goto repeat;
-found_good:
+	
 	clear_inode(best);
 	best->i_count = 1;
 	best->i_nlink = 1;
------- End of forwarded message -------

home help back first fref pref prev next nref lref last post