aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/torture.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index b30c2ee78580..1bafd02d1eed 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -439,9 +439,9 @@ static int torture_shutdown_notify(struct notifier_block *unused1,
439 unsigned long unused2, void *unused3) 439 unsigned long unused2, void *unused3)
440{ 440{
441 mutex_lock(&fullstop_mutex); 441 mutex_lock(&fullstop_mutex);
442 if (fullstop == FULLSTOP_DONTSTOP) { 442 if (ACCESS_ONCE(fullstop) == FULLSTOP_DONTSTOP) {
443 VERBOSE_TOROUT_STRING("Unscheduled system shutdown detected"); 443 VERBOSE_TOROUT_STRING("Unscheduled system shutdown detected");
444 fullstop = FULLSTOP_SHUTDOWN; 444 ACCESS_ONCE(fullstop) = FULLSTOP_SHUTDOWN;
445 } else { 445 } else {
446 pr_warn("Concurrent rmmod and shutdown illegal!\n"); 446 pr_warn("Concurrent rmmod and shutdown illegal!\n");
447 } 447 }
@@ -575,13 +575,13 @@ EXPORT_SYMBOL_GPL(torture_init_end);
575bool torture_cleanup(void) 575bool torture_cleanup(void)
576{ 576{
577 mutex_lock(&fullstop_mutex); 577 mutex_lock(&fullstop_mutex);
578 if (fullstop == FULLSTOP_SHUTDOWN) { 578 if (ACCESS_ONCE(fullstop) == FULLSTOP_SHUTDOWN) {
579 pr_warn("Concurrent rmmod and shutdown illegal!\n"); 579 pr_warn("Concurrent rmmod and shutdown illegal!\n");
580 mutex_unlock(&fullstop_mutex); 580 mutex_unlock(&fullstop_mutex);
581 schedule_timeout_uninterruptible(10); 581 schedule_timeout_uninterruptible(10);
582 return true; 582 return true;
583 } 583 }
584 fullstop = FULLSTOP_RMMOD; 584 ACCESS_ONCE(fullstop) = FULLSTOP_RMMOD;
585 mutex_unlock(&fullstop_mutex); 585 mutex_unlock(&fullstop_mutex);
586 unregister_reboot_notifier(&torture_shutdown_nb); 586 unregister_reboot_notifier(&torture_shutdown_nb);
587 torture_shuffle_cleanup(); 587 torture_shuffle_cleanup();
@@ -605,6 +605,6 @@ EXPORT_SYMBOL_GPL(torture_must_stop);
605 */ 605 */
606bool torture_must_stop_irq(void) 606bool torture_must_stop_irq(void)
607{ 607{
608 return fullstop != FULLSTOP_DONTSTOP; 608 return ACCESS_ONCE(fullstop) != FULLSTOP_DONTSTOP;
609} 609}
610EXPORT_SYMBOL_GPL(torture_must_stop_irq); 610EXPORT_SYMBOL_GPL(torture_must_stop_irq);