mtd/fs/jffs2 readinode.c,1.74,1.75

David Woodhouse dwmw2 at infradead.org
Mon Aug 26 10:20:51 EDT 2002


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

Modified Files:
	readinode.c 
Log Message:
don't oops when clearing bad inode

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- readinode.c	20 Aug 2002 21:37:28 -0000	1.74
+++ readinode.c	26 Aug 2002 14:20:48 -0000	1.75
@@ -393,7 +393,7 @@
 	/* If it's a deleted inode, grab the alloc_sem to keep the
 	   (maybe temporary) BUG() in jffs2_mark_node_obsolete() 
 	   from triggering */
-	if(!f->inocache->nlink)
+	if(f->inocache && !f->inocache->nlink)
 		down(&c->alloc_sem);
 
 	down(&f->sem);
@@ -401,7 +401,7 @@
 	frags = f->fraglist;
 	fds = f->dents;
 	if (f->metadata) {
-		if (!f->inocache->nlink)
+		if (f->inocache && !f->inocache->nlink)
 			jffs2_mark_node_obsolete(c, f->metadata->raw);
 		jffs2_free_full_dnode(f->metadata);
 	}
@@ -413,7 +413,7 @@
 
 		if (frag->node && !(--frag->node->frags)) {
 			/* Not a hole, and it's the final remaining frag of this node. Free the node */
-			if (!f->inocache->nlink)
+			if (f->inocache && !f->inocache->nlink)
 				jffs2_mark_node_obsolete(c, frag->node->raw);
 
 			jffs2_free_full_dnode(frag->node);
@@ -427,7 +427,7 @@
 	}
 
 	/* Urgh. Is there a nicer way to do this? */
-	if(!f->inocache->nlink) {
+	if(f->inocache && !f->inocache->nlink) {
 		up(&f->sem);
 		up(&c->alloc_sem);
 	} else {





More information about the linux-mtd-cvs mailing list