From 0b2d8813cb2b7344d8dbc35c1d56f525562a221f Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 20 Apr 2011 16:01:05 +0300 Subject: fs-tests: integck: refuse R/O file-system Refuse to test the file-system if it is mounted Read-only. Signed-off-by: Artem Bityutskiy --- tests/fs-tests/integrity/integck.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index e6f5b3b..136be09 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -2681,10 +2681,15 @@ int main(int argc, char *argv[]) random_name_buf = malloc(fsinfo.max_name_len + 1); CHECK(random_name_buf != NULL); + /* Refuse the file-system if it is mounted R/O */ + if (fsinfo.mount_flags & MS_RDONLY) { + ret = -1; + errmsg("the file-system is mounted read-only"); + goto out_free; + } + /* Do the actual test */ ret = integck(); - if (ret) - return EXIT_FAILURE; close_open_files(); free_fs_info(top_dir); @@ -2692,10 +2697,11 @@ int main(int argc, char *argv[]) free(top_dir->entry); free(top_dir); +out_free: free(random_name_buf); free(fsinfo.mount_point); free(fsinfo.fstype); free(fsinfo.fsdev); free(fsinfo.test_dir); - return EXIT_SUCCESS; + return ret ? EXIT_FAILURE : EXIT_SUCCESS; } -- cgit v1.2.3