aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodelist.c
diff options
context:
space:
mode:
authorArtem B. Bityutskiy <dedekind@infradead.org>2005-08-17 10:57:43 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 14:29:56 -0500
commit280562b2104c9a0ca7efc5e716b6452a7ba820fa (patch)
tree6dcee70d0ec3da6fbb8afd9e05e6b73c1a46e97a /fs/jffs2/nodelist.c
parent8d5df40954281a8e0f788b311f9c08f96e530ffa (diff)
[JFFS2] Calculate CRC check starting point correctly
When data starts from the beginning of NAND page, 'len' must be zero, not c->wbuf_page. Thanks to Zoltan Sogor for reporting this problem. Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/nodelist.c')
-rw-r--r--fs/jffs2/nodelist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index 0393d27eafc7..fd21f109fbd2 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.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: nodelist.c,v 1.110 2005/08/17 14:13:45 dedekind Exp $ 10 * $Id: nodelist.c,v 1.111 2005/08/17 14:57:39 dedekind Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -413,7 +413,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
413 /* Calculate how many bytes were already checked */ 413 /* Calculate how many bytes were already checked */
414 ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode); 414 ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);
415 len = ofs & (c->wbuf_pagesize - 1); 415 len = ofs & (c->wbuf_pagesize - 1);
416 len = c->wbuf_pagesize - len; 416 if (likely(len))
417 len = c->wbuf_pagesize - len;
417 418
418 if (len >= tn->csize) { 419 if (len >= tn->csize) {
419 JFFS2_DBG_READINODE("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n", 420 JFFS2_DBG_READINODE("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",