diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-17 06:19:38 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-20 12:48:42 +0300 |
commit | a38739e69da193eba333b6d671d008d6006d3db5 (patch) | |
tree | 184d039ede36ce3c1a49f9b5c293b53257e60e3a /tests | |
parent | 3a6619020d775b54bcd799e94ea291f7de104c75 (diff) |
fs-tests: integck: verify clean files
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fs-tests/integrity/integck.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index 944ff3c..221bd49 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -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 */ |