[Ocfs2-test-devel] [PATCH 23/59] gen_extents: fix wrong filename validation

Junxiao Bi junxiao.bi at oracle.com
Sun Sep 13 19:44:09 PDT 2015


From: Jeff Liu <jeff.liu at oracle.com>

if (!filename) should always be evaluated to true, check filename[0] instead.

Signed-off-by: Jie Liu <jeff.liu at oracle.com>
Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
---
 programs/discontig_bg_test/gen_extents.c |    2 +-
 programs/reflink_tests/reflink_test.c    |    5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/programs/discontig_bg_test/gen_extents.c b/programs/discontig_bg_test/gen_extents.c
index 8ce9ae2..e1d34cd 100755
--- a/programs/discontig_bg_test/gen_extents.c
+++ b/programs/discontig_bg_test/gen_extents.c
@@ -98,7 +98,7 @@ int parse_opts(int argc, char **argv)
 		}
 	}
 
-	if (!filename) {
+	if (!filename[0]) {
 		fprintf(stderr, "filename is a mandatory option\n");
 		usage();
 	}
diff --git a/programs/reflink_tests/reflink_test.c b/programs/reflink_tests/reflink_test.c
index 22386db..9b666d6 100755
--- a/programs/reflink_tests/reflink_test.c
+++ b/programs/reflink_tests/reflink_test.c
@@ -2058,10 +2058,7 @@ static int destructive_test(void)
 					}
 				}
 
-				/*
-				 * Are you ready to crash the machine?
-				*/
-
+				/* Are you ready to crash the machine? */
 				if ((j > 1) && (j < chunk_no - 1)) {
 					if (get_rand(1, chunk_no) == chunk_no / 2) {
 
-- 
1.7.9.5




More information about the Ocfs2-test-devel mailing list