diff options
author | Joe Thornber <thornber@redhat.com> | 2014-06-27 15:29:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-17 15:58:02 -0700 |
commit | 09edef606e5e1804e354f3a7d50fd96bd55bd1f8 (patch) | |
tree | c840ca27195d38b58e992f821d4470080e6c7ff1 /fs | |
parent | 17256c6385fd3a5e000a9d2e9b89eb09f70b46e6 (diff) | |
download | linux-3.10-09edef606e5e1804e354f3a7d50fd96bd55bd1f8.tar.gz linux-3.10-09edef606e5e1804e354f3a7d50fd96bd55bd1f8.tar.bz2 linux-3.10-09edef606e5e1804e354f3a7d50fd96bd55bd1f8.zip |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions