/*
* YAFFS: Yet another FFS. A NAND-flash specific file system.
*
- * Copyright (C) 2002-2010 Aleph One Ltd.
+ * Copyright (C) 2002-2011 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
#include <stdio.h>
+extern int fuzz_test;
#if 1
#define FSX_INIT(mount_pt) do{ if(interleave_fsx) yaffs_fsx_init(mount_pt); } while(0)
MakeName(fullTempMainName,prefix,"tmp-main");
}
-static void FatalError(int lineNo)
+static void FatalError(int line_no)
{
- printf("Integrity error %d\n",lineNo);
+ printf("Integrity error %d\n",line_no);
+
+ if(fuzz_test)
+ return;
+
if(ext_fatal)
ext_fatal();
struct yaffs_stat s;
char str[1000];
int error_line = 0;
+ int nentries;
d = yaffs_opendir(dname);
}
else
{
+ nentries = 0;
while((de = yaffs_readdir(d)) != NULL)
{
strcpy(str,dname);
strcat(str,"/");
strcat(str,de->d_name);
+ nentries++;
yaffs_lstat(str,&s);
dump_directory_tree_worker(str,1);
if(s.st_ino > 10000)
- error_line = __LINE__;
+ error_line = __LINE__;
}
+ if(strstr(dname,"lost+found") && nentries >0){
+ printf("\n\n!!! HEY lost+found not empty, had %d entries\n\n\n",nentries);
+ error_line = __LINE__;
+ }
+
if(error_line && !no_verification)
FatalError(error_line);
static unsigned xx[XX_SIZE];
-static int yWriteFile(const char *fname, unsigned sz32)
+static int y_wr_file(const char *fname, unsigned sz32)
{
int h;
int r;
}
-static int yVerifyFile(const char *fName)
+static int y_verify_file(const char *fName)
{
unsigned checksum = 0;
unsigned totalSize;
int sz32;
sz32 = (myrand() % 1000) + 20;
- result = yWriteFile(fullTempMainName,sz32);
+ result = y_wr_file(fullTempMainName,sz32);
FSX();
if(!no_verification && result)
FatalError(__LINE__);
int result;
if(no_verification)
return;
- result = yVerifyFile(fullMainName);
+ result = y_verify_file(fullMainName);
if(result)
FatalError(__LINE__);