From 2b4c0f1a7cd964a2143a2d4455ea02f3ec427cf3 Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Sun, 4 Apr 2010 02:54:27 -0300
Subject: [PATCH 12/15] tests/stress: Make --fi and --nproc > 1 incompatible

Due to the way the stress tests are performed (with extensive jfsck), --fi and
--nproc are not really compatible, as it causes corruption reports that are
not real.

This patch makes the stress tests not run with that combination of options.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
 tests/stress/jiostress |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/stress/jiostress b/tests/stress/jiostress
index 26b0f79..80c65fe 100755
--- a/tests/stress/jiostress
+++ b/tests/stress/jiostress
@@ -636,7 +636,7 @@ def main():
 		help = "number of processes (defaults to %default)")
 	parser.add_option("", "--fi", dest = "use_fi",
 		action = "store_true", default = False,
-		help = "use fault injection (conflicts with --as)")
+		help = "use fault injection (conflicts with --as and -p > 1)")
 	parser.add_option("", "--as", dest = "use_as",
 		action = "store_true", default = False,
 		help = "use J_LINGER + autosync (conflicts with --fi)")
@@ -668,6 +668,10 @@ def main():
 		print("Error: --fi and --as cannot be used together")
 		sys.exit(1)
 
+	if options.use_fi and options.nproc > 1:
+		print("Error: --fi cannot be used with multiple processes")
+		sys.exit(1)
+
 	if not options.use_internal_locks:
 		options.do_verify = False
 
-- 
1.6.2.2.646.gb214

