aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jffs2/erase.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index 65d91943fc2d..5e2719cb6930 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -350,9 +350,11 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
350 break; 350 break;
351 } while(--retlen); 351 } while(--retlen);
352 c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size); 352 c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
353 if (retlen) 353 if (retlen) {
354 printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n", 354 printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n",
355 *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf)); 355 *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf));
356 return -EIO;
357 }
356 return 0; 358 return 0;
357 } 359 }
358 do_flash_read: 360 do_flash_read:
@@ -373,10 +375,12 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
373 ret = c->mtd->read(c->mtd, ofs, readlen, &retlen, ebuf); 375 ret = c->mtd->read(c->mtd, ofs, readlen, &retlen, ebuf);
374 if (ret) { 376 if (ret) {
375 printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); 377 printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret);
378 ret = -EIO;
376 goto fail; 379 goto fail;
377 } 380 }
378 if (retlen != readlen) { 381 if (retlen != readlen) {
379 printk(KERN_WARNING "Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", ofs, readlen, retlen); 382 printk(KERN_WARNING "Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", ofs, readlen, retlen);
383 ret = -EIO;
380 goto fail; 384 goto fail;
381 } 385 }
382 for (i=0; i<readlen; i += sizeof(unsigned long)) { 386 for (i=0; i<readlen; i += sizeof(unsigned long)) {
@@ -385,6 +389,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
385 if (*datum + 1) { 389 if (*datum + 1) {
386 *bad_offset += i; 390 *bad_offset += i;
387 printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", *datum, *bad_offset); 391 printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", *datum, *bad_offset);
392 ret = -EIO;
388 goto fail; 393 goto fail;
389 } 394 }
390 } 395 }