aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r--fs/jffs2/scan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7654e87b0428..9ad5ba4b299b 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -510,6 +510,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
510 sumlen = c->sector_size - je32_to_cpu(sm->offset); 510 sumlen = c->sector_size - je32_to_cpu(sm->offset);
511 sumptr = buf + buf_size - sumlen; 511 sumptr = buf + buf_size - sumlen;
512 512
513 /* sm->offset maybe wrong but MAGIC maybe right */
514 if (sumlen > c->sector_size)
515 goto full_scan;
516
513 /* Now, make sure the summary itself is available */ 517 /* Now, make sure the summary itself is available */
514 if (sumlen > buf_size) { 518 if (sumlen > buf_size) {
515 /* Need to kmalloc for this. */ 519 /* Need to kmalloc for this. */
@@ -544,6 +548,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
544 } 548 }
545 } 549 }
546 550
551full_scan:
547 buf_ofs = jeb->offset; 552 buf_ofs = jeb->offset;
548 553
549 if (!buf_size) { 554 if (!buf_size) {