summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodelist.c
diff options
context:
space:
mode:
authorArtem B. Bityutskiy <dedekind@infradead.org>2005-08-17 15:57:43 +0100
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 20:29:56 +0100
commit280562b2104c9a0ca7efc5e716b6452a7ba820fa (patch)
tree6dcee70d0ec3da6fbb8afd9e05e6b73c1a46e97a /fs/jffs2/nodelist.c
parent8d5df40954281a8e0f788b311f9c08f96e530ffa (diff)
downloadlinux-280562b2104c9a0ca7efc5e716b6452a7ba820fa.tar.bz2
[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 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
- * $Id: nodelist.c,v 1.110 2005/08/17 14:13:45 dedekind Exp $
+ * $Id: nodelist.c,v 1.111 2005/08/17 14:57:39 dedekind Exp $
*
*/
@@ -413,7 +413,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
/* Calculate how many bytes were already checked */
ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);
len = ofs & (c->wbuf_pagesize - 1);
- len = c->wbuf_pagesize - len;
+ if (likely(len))
+ len = c->wbuf_pagesize - len;
if (len >= tn->csize) {
JFFS2_DBG_READINODE("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",