mtd/fs/jffs2 readinode.c,1.92,1.93

David Woodhouse dwmw2 at infradead.org
Tue Oct 8 11:57:36 EDT 2002


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv6841

Modified Files:
	readinode.c 
Log Message:
Adjust comment in jffs2_do_clear_inode() to reflect the fact that it
actually prevents a race with iget() in jffs2_garbage_collect_pass().


Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- readinode.c	10 Sep 2002 07:37:55 -0000	1.92
+++ readinode.c	8 Oct 2002 15:57:33 -0000	1.93
@@ -487,9 +487,16 @@
 	   without f->sem. It can never get undeleted. */
 	int deleted = f->inocache && !f->inocache->nlink;
 
-	/* If it's a deleted inode, grab the alloc_sem to keep the
-	   (maybe temporary) BUG() in jffs2_mark_node_obsolete() 
-	   from triggering */
+	/* If it's a deleted inode, grab the alloc_sem. This prevents
+	   jffs2_garbage_collect_pass() from deciding that it wants to
+	   garbage collect one of the nodes we're just about to mark 
+	   obsolete -- by the time we drop alloc_sem and return, all
+	   the nodes are marked obsolete, and jffs2_g_c_pass() won't
+	   call iget() for the inode in question.
+
+	   We also do this to keep the (maybe temporary) BUG() in 
+	   jffs2_mark_node_obsolete() from triggering. 
+	*/
 	if(deleted)
 		down(&c->alloc_sem);
 
@@ -518,5 +525,4 @@
 
 	if(deleted)
 		up(&c->alloc_sem);
-
 }





More information about the linux-mtd-cvs mailing list