aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/readinode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/readinode.c')
-rw-r--r--fs/jffs2/readinode.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 488787a823b6..e6076fa5560f 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: readinode.c,v 1.135 2005/08/01 12:05:19 dedekind Exp $ 10 * $Id: readinode.c,v 1.137 2005/08/03 09:26:46 dedekind Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -278,10 +278,11 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
278 278
279 /* If we actually calculated the whole data CRC 279 /* If we actually calculated the whole data CRC
280 * and it is wrong, drop the node. */ 280 * and it is wrong, drop the node. */
281 if (unlikely(tn->partial_crc 281 if (len == csize && unlikely(tn->partial_crc != je32_to_cpu(rd->data_crc))) {
282 != je32_to_cpu(rd->data_crc)) && 282 JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
283 len == csize) 283 ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc));
284 goto free_out; 284 goto free_out;
285 }
285 286
286 } else if (csize == 0) { 287 } else if (csize == 0) {
287 /* 288 /*
@@ -521,10 +522,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
521 bufstart = buf + (ref_offset(ref) % c->wbuf_pagesize); 522 bufstart = buf + (ref_offset(ref) % c->wbuf_pagesize);
522 /* We will read either one wbuf or 2 wbufs. */ 523 /* We will read either one wbuf or 2 wbufs. */
523 len = c->wbuf_pagesize - (bufstart - buf); 524 len = c->wbuf_pagesize - (bufstart - buf);
524 if (JFFS2_MIN_NODE_HEADER + 525 if (JFFS2_MIN_NODE_HEADER + (int)(bufstart - buf) > c->wbuf_pagesize) {
525 (int)(bufstart - buf) > c->wbuf_pagesize) { 526 /* The header spans the border of the first wbuf */
526 /* The header spans the border of the
527 * first wbuf */
528 len += c->wbuf_pagesize; 527 len += c->wbuf_pagesize;
529 } 528 }
530 } else { 529 } else {