]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: verify clean files
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 17 May 2011 03:19:38 +0000 (06:19 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 20 May 2011 09:48:42 +0000 (12:48 +0300)
Allow verification for clean files, i.e. the files which had been fsync()'ed
before the emulated power cut happened.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/fs-tests/integrity/integck.c

index 944ff3ceecf85658fe4c134407e5d71fe42ecf3b..221bd4985e004a1935ca56006b3dee4be15b4022 100644 (file)
@@ -1481,7 +1481,8 @@ static void file_check_data(struct file_info *file, int fd,
        char buf[IO_BUFFER_SIZE];
        unsigned int seed = w->random_seed;
 
-       assert(!args.power_cut_mode);
+       if (args.power_cut_mode && !file->clean)
+               return;
 
        for (r = 0; r < w->random_offset; ++r)
                rand_r(&seed);
@@ -1517,7 +1518,11 @@ static void file_check(struct file_info *file, int fd)
        struct dir_entry_info *entry;
        struct stat st;
 
-       if (args.power_cut_mode)
+       /*
+        * In case of power cut emulation testing check only clean files, i.e.
+        * the files which have not been modified since last 'fsync()'.
+        */
+       if (args.power_cut_mode && !file->clean)
                return;
 
        /* Do not check files that have errored */