aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/gc.c')
-rw-r--r--fs/jffs2/gc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 95be264fe9b6..f25e485ed879 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -608,10 +608,15 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
608 goto bail; 608 goto bail;
609 } 609 }
610 610
611 if (strnlen(node->d.name, node->d.nsize) != node->d.nsize) {
612 printk(KERN_WARNING "Name in dirent node at 0x%08x contains zeroes\n", ref_offset(raw));
613 goto bail;
614 }
615
611 if (node->d.nsize) { 616 if (node->d.nsize) {
612 crc = crc32(0, node->d.name, node->d.nsize); 617 crc = crc32(0, node->d.name, node->d.nsize);
613 if (je32_to_cpu(node->d.name_crc) != crc) { 618 if (je32_to_cpu(node->d.name_crc) != crc) {
614 printk(KERN_WARNING "Name CRC failed on REF_PRISTINE dirent ode at 0x%08x: Read 0x%08x, calculated 0x%08x\n", 619 printk(KERN_WARNING "Name CRC failed on REF_PRISTINE dirent node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
615 ref_offset(raw), je32_to_cpu(node->d.name_crc), crc); 620 ref_offset(raw), je32_to_cpu(node->d.name_crc), crc);
616 goto bail; 621 goto bail;
617 } 622 }