diff options
author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2007-03-10 11:08:44 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-24 23:13:06 -0400 |
commit | 0dec4c8bc6ed62a65b61594aa754e21270423796 (patch) | |
tree | 42f4f16e9173fc75aa27e69510b9b4e123122d30 /fs/jffs2/readinode.c | |
parent | df8e96f39103adf5a13332d784040a2c62667243 (diff) |
[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/readinode.c')
-rw-r--r-- | fs/jffs2/readinode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 49d4b0a67c55..b09fa23abe53 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -1054,10 +1054,10 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
1054 | jffs2_mark_node_obsolete(c, ref); | 1054 | jffs2_mark_node_obsolete(c, ref); |
1055 | goto cont; | 1055 | goto cont; |
1056 | } | 1056 | } |
1057 | /* Due to poor choice of crc32 seed, an all-zero node will have a correct CRC */ | 1057 | if (je16_to_cpu(node->u.magic) != JFFS2_MAGIC_BITMASK) { |
1058 | if (!je32_to_cpu(node->u.hdr_crc) && !je16_to_cpu(node->u.nodetype) && | 1058 | /* Not a JFFS2 node, whinge and move on */ |
1059 | !je16_to_cpu(node->u.magic) && !je32_to_cpu(node->u.totlen)) { | 1059 | JFFS2_NOTICE("Wrong magic bitmask 0x%04x in node header at %#08x.\n", |
1060 | JFFS2_NOTICE("All zero node header at %#08x.\n", ref_offset(ref)); | 1060 | je16_to_cpu(node->u.magic), ref_offset(ref)); |
1061 | jffs2_mark_node_obsolete(c, ref); | 1061 | jffs2_mark_node_obsolete(c, ref); |
1062 | goto cont; | 1062 | goto cont; |
1063 | } | 1063 | } |