]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
[JFFS2] Forbid to free inode_cache objects if its nlink isn't zero.
authorArtem B. Bityuckiy <dedekind@infradead.org>
Sun, 20 Mar 2005 17:46:23 +0000 (17:46 +0000)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Mon, 23 May 2005 11:02:39 +0000 (13:02 +0200)
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/jffs2/erase.c
fs/jffs2/nodemgmt.c

index d1ae565352a6e521115e2afa935d27ef6654f75a..bed6e1b8d824238d8bf7026ce2bd1f8d61e56fae 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: erase.c,v 1.72 2005/02/27 23:01:32 dwmw2 Exp $
+ * $Id: erase.c,v 1.74 2005/03/20 17:46:20 dedekind Exp $
  *
  */
 
@@ -277,7 +277,7 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c,
                printk("\n");
        });
 
-       if (ic->nodes == (void *)ic)
+       if (ic->nodes == (void *)ic && ic->nlink == 0)
                jffs2_del_ino_cache(c, ic);
 }
 
index 456adf020f22439caa661a629a591fdd2a27e43c..a8e1982312308f09bdc47fe1c1325034fcef3bae 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: nodemgmt.c,v 1.119 2005/02/28 08:21:05 dedekind Exp $
+ * $Id: nodemgmt.c,v 1.120 2005/03/20 17:46:20 dedekind Exp $
  *
  */
 
@@ -594,7 +594,7 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
                *p = ref->next_in_ino;
                ref->next_in_ino = NULL;
 
-               if (ic->nodes == (void *)ic)
+               if (ic->nodes == (void *)ic && ic->nlink == 0)
                        jffs2_del_ino_cache(c, ic);
 
                spin_unlock(&c->erase_completion_lock);