aboutsummaryrefslogtreecommitdiff
path: root/lib/cpu-notifier-error-inject.c
diff options
context:
space:
mode:
authorJoe Thornber <thornber@redhat.com>2014-06-27 15:29:04 -0400
committerJiri Slaby <jslaby@suse.cz>2014-07-18 15:51:24 +0200
commit86def8656e3133d68f91cbccd30e74deea9edb7c (patch)
tree483a75cbfca719c12727917b3e3455cb44ea6828 /lib/cpu-notifier-error-inject.c
parent71a046b808d524809937d06e279bf9a291fb58b8 (diff)
dm io: fix a race condition in the wake up code for sync_io
commit 10f1d5d111e8aed46a0f1179faf9a3cf422f689e upstream. There's a race condition between the atomic_dec_and_test(&io->count) in dec_count() and the waking of the sync_io() thread. If the thread is spuriously woken immediately after the decrement it may exit, making the on stack io struct invalid, yet the dec_count could still be using it. Fix this race by using a completion in sync_io() and dec_count(). Reported-by: Minfei Huang <huangminfei@ucloud.cn> Signed-off-by: Joe Thornber <thornber@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions