rcutorture: Warn on bad torture type for built-in tests
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 Jul 2018 00:35:22 +0000 (17:35 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 29 Aug 2018 16:20:48 +0000 (09:20 -0700)
When running a built-in rcutorture test, specifying an invalid torture
type results in what looks like a hard hang, with the error messages
hidden by other boot-time output.  This commit therefore executes a
WARN_ON() in this case so that the splat appears just following the
error messages.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcutorture.c

index 50a4f0ed4ebf804694b202d9b2058962aca36409..5df2411f7aee91efb1146e642f252fa7a61dc5a5 100644 (file)
@@ -1968,6 +1968,7 @@ rcu_torture_init(void)
                for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
                        pr_cont(" %s", torture_ops[i]->name);
                pr_cont("\n");
+               WARN_ON(!IS_MODULE(CONFIG_RCU_TORTURE_TEST));
                firsterr = -EINVAL;
                goto unwind;
        }