diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-04-24 09:58:06 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-04-25 20:04:30 +0300 |
commit | 54cb6ff01a7936d7a160a65f5b28f735c05ff3d4 (patch) | |
tree | 4a611efa863d7d3d2dea9674038ec2e4291ee737 | |
parent | 1fdadd77de15ca3c7fccf576aea9e371d36f4d31 (diff) |
fs-tests: integck: do not run checking when in power cut mode
Do not check the file-system when we are in power cut mode. Currently
we still check the FS if we did not encounter any error, and the test
fails sometimes because meanwhile write-back encounters an error and
drops pages. Disable the checking so far. It should be enabled when
we implement the 'clean' flag for files.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r-- | tests/fs-tests/integrity/integck.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index 52433ba..80d34c0 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -2507,9 +2507,32 @@ static int remount_tested_fs(void) static void check_tested_fs(void) { - check_run_no += 1; - dir_check(top_dir); - check_deleted_files(); + /* + * when we are in power cut mode we can only test files which have not + * been modified since the last successful 'fsync()'. this is not + * implemented yet. + * + * note, even if we have not encounter any error during the test, we + * cannot test the file-system. indeed, consider the situation when we + * have written data to file a. a lot of the data is currently cached + * and is waiting for write-back. when write-back happens, an emulated + * power cut may also happen and cause write-back to drop the errored + * pages. and if we start checking the file a after this, we'll fail as + * well. + * + * and even re-mounting will not help, because re-mounting will cause + * full sync which may fail and data pages will be dropped, but + * 'unmount()' will nevertheless succeed, and if we check the + * file-system after this - the check will fail. + * + * and 'sync()' will not help as well since it does not return an + * error. + */ + if (!args.power_cut_mode) { + check_run_no += 1; + dir_check(top_dir); + check_deleted_files(); + } } /* @@ -2985,14 +3008,6 @@ int main(int argc, char *argv[]) * When testing emulated power cuts we have to be able * to re-mount the file-system to clean the EROFS * state. - * - * But there is also another reason. Imaging the test - * writes many files successfully, and decides to check - * them. But the test has done many modifications, so - * there will be write-back. And when write-back fails, - * Linux discards the dirty pages. So, if meanwhile FS - * write-back encounters emulated power cut error, the - * file checking will fail as well. */ errmsg("power cut mode requers unmountable FS"); goto out_free; |