[1650] in SIPB_Linux_Development

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

Re: revised patch to (hopefully) fix and/or find afs cache corruption

daemon@ATHENA.MIT.EDU (Theodore Y. Ts'o)
Wed Apr 9 23:03:02 1997

Date: Wed, 9 Apr 1997 23:02:46 -0400
From: "Theodore Y. Ts'o" <tytso@MIT.EDU>
To: Erik Nygren <nygren@MIT.EDU>
Cc: linux-dev@MIT.EDU, linux-afs-bugs@MIT.EDU
In-Reply-To: Erik Nygren's message of Wed, 09 Apr 1997 21:13:33 EDT,
	<199704100113.VAA01991@zocalo.mit.edu>

Here's one more patch to fs/inode.c which may help:

----------------------------------------------------------------
--- inode.c.~1~	Thu Sep  4 11:22:24 1980
+++ inode.c	Sat Apr  5 22:42:22 1997
@@ -173,6 +173,7 @@
 {
 	struct wait_queue * wait;
 
+	inode->i_count++;
	lock_inode(inode);
 	truncate_inode_pages(inode, 0);
 	if (IS_WRITABLE(inode)) {
@@ -182,6 +184,7 @@
 	remove_inode_hash(inode);
 	remove_inode_free(inode);
 	wait = ((volatile struct inode *) inode)->i_wait;
+	inode->i_count--;
 	if (inode->i_count)
 		nr_free_inodes++;
 	memset(inode,0,sizeof(*inode));
----------------------------------------------------------------

This patch was suggested by Stephen Tweedie, to prevent a case where
while the inode is locked and we're waiting for it to become free,
another process manages to grab the inode anyway.

Yes, the change I made to lock_inode() wasn't really necessary.

						- Ted

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