[JFFS2] Deletion dirents should be REF_NORMAL, not REF_PRISTINE.
[safe/jmp/linux-2.6] / fs / jffs2 / scan.c
index 7a46a43..6c75cd4 100644 (file)
@@ -1,15 +1,14 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2001-2003 Red Hat, Inc.
+ * Copyright © 2001-2007 Red Hat, Inc.
  *
  * Created by David Woodhouse <dwmw2@infradead.org>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: scan.c,v 1.125 2005/09/30 13:59:13 dedekind Exp $
- *
  */
+
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -741,18 +740,8 @@ scan_more:
                        ofs += 4;
                        continue;
                }
-               /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */
-               if (!je32_to_cpu(node->hdr_crc) && !je16_to_cpu(node->nodetype) &&
-                   !je16_to_cpu(node->magic) && !je32_to_cpu(node->totlen)) {
-                       noisy_printk(&noise, "jffs2_scan_eraseblock(): All zero node header at 0x%08x.\n", ofs);
-                       if ((err = jffs2_scan_dirty_space(c, jeb, 4)))
-                               return err;
-                       ofs += 4;
-                       continue;
-               }
 
-               if (ofs + je32_to_cpu(node->totlen) >
-                   jeb->offset + c->sector_size) {
+               if (ofs + je32_to_cpu(node->totlen) > jeb->offset + c->sector_size) {
                        /* Eep. Node goes over the end of the erase block. */
                        printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n",
                               ofs, je32_to_cpu(node->totlen));
@@ -1060,7 +1049,8 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
                return -ENOMEM;
        }
 
-       fd->raw = jffs2_link_node_ref(c, jeb, ofs | REF_PRISTINE, PAD(je32_to_cpu(rd->totlen)), ic);
+       fd->raw = jffs2_link_node_ref(c, jeb, ofs | dirent_node_state(rd),
+                                     PAD(je32_to_cpu(rd->totlen)), ic);
 
        fd->next = NULL;
        fd->version = je32_to_cpu(rd->version);