Skip to content

Commit

Permalink
Proposed fix for oops on SIGINT in splat atomic:64-bit test.
Browse files Browse the repository at this point in the history
The threads in the splat atomic:64-bit test share the data structure
atomic_priv_t ap, which lives on the kernel stack of the splat user-space
utility.  If splat terminates before the threads, accesses to that memory
location by the other threads become invalid.  Splat synchronizes with
the threads with the call:

wait_event_interruptible(ap.ap_waitq, splat_atomic_test1_cond(&ap, i));

Apparently, the SIGINT wakes and terminates splat prematurely, so that
GPFs or other bad things happen when the threads subsequently access ap.
This commit prevents this by using the uninterruptible form:

wait_event(ap.ap_waitq, splat_atomic_test1_cond(&ap, i));
  • Loading branch information
nedbass authored and behlendorf committed Jul 15, 2010
1 parent d0bd694 commit 8f813bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/splat/splat-atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ splat_atomic_test1(struct file *file, void *arg)
schedule();
}

wait_event_interruptible(ap.ap_waitq, splat_atomic_test1_cond(&ap, i));
wait_event(ap.ap_waitq, splat_atomic_test1_cond(&ap, i));

if (rc) {
splat_vprint(file, SPLAT_ATOMIC_TEST1_NAME, "Only started "
Expand Down

0 comments on commit 8f813bb

Please sign in to comment.