Skip to content

Commit f2bdf7d

Browse files
committed
scftorture: Warn on individual scf_torture_init() error conditions
When running scftorture as a module, any scf_torture_init() issues will be reflected in the error code from modprobe or insmod, as the case may be. However, these error codes are not available when running scftorture built-in, for example, when using the kvm.sh script. This commit therefore adds WARN_ON_ONCE() to allow distinguishing scf_torture_init() errors when running scftorture built-in. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent c3d0258 commit f2bdf7d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/scftorture.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,17 +606,17 @@ static int __init scf_torture_init(void)
606606

607607
if (onoff_interval > 0) {
608608
firsterr = torture_onoff_init(onoff_holdoff * HZ, onoff_interval, NULL);
609-
if (firsterr)
609+
if (torture_init_error(firsterr))
610610
goto unwind;
611611
}
612612
if (shutdown_secs > 0) {
613613
firsterr = torture_shutdown_init(shutdown_secs, scf_torture_cleanup);
614-
if (firsterr)
614+
if (torture_init_error(firsterr))
615615
goto unwind;
616616
}
617617
if (stutter > 0) {
618618
firsterr = torture_stutter_init(stutter, stutter);
619-
if (firsterr)
619+
if (torture_init_error(firsterr))
620620
goto unwind;
621621
}
622622

@@ -637,12 +637,12 @@ static int __init scf_torture_init(void)
637637
scf_stats_p[i].cpu = i;
638638
firsterr = torture_create_kthread(scftorture_invoker, (void *)&scf_stats_p[i],
639639
scf_stats_p[i].task);
640-
if (firsterr)
640+
if (torture_init_error(firsterr))
641641
goto unwind;
642642
}
643643
if (stat_interval > 0) {
644644
firsterr = torture_create_kthread(scf_torture_stats, NULL, scf_torture_stats_task);
645-
if (firsterr)
645+
if (torture_init_error(firsterr))
646646
goto unwind;
647647
}
648648

0 commit comments

Comments
 (0)