summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/scan.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2007-03-10 17:08:44 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2007-04-25 04:13:06 +0100
commit0dec4c8bc6ed62a65b61594aa754e21270423796 (patch)
tree42f4f16e9173fc75aa27e69510b9b4e123122d30 /fs/jffs2/scan.c
parentdf8e96f39103adf5a13332d784040a2c62667243 (diff)
downloadlinux-stable-0dec4c8bc6ed62a65b61594aa754e21270423796.tar.gz
linux-stable-0dec4c8bc6ed62a65b61594aa754e21270423796.tar.bz2
linux-stable-0dec4c8bc6ed62a65b61594aa754e21270423796.zip
[JFFS2] Better fix for all-zero node headers
No need to check for all-zero header since the header cannot be zero due to other checks. Replace the all-zero header check in readinode.c with a check for the magic word. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r--fs/jffs2/scan.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7a46a436edfc..858e3ed8e23d 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -741,18 +741,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));