]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: update AioCompletion return value before evaluating pending count
authorJason Dillaman <dillaman@redhat.com>
Tue, 13 Oct 2020 01:34:25 +0000 (21:34 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 13 Oct 2020 12:34:07 +0000 (08:34 -0400)
commit94f3bce53c39017028ce44a80697f55af2a82e68
treeebb4ba26166a704cfc8a09d493cc595864fdb144
parent0f3bce753a35fbd8a6ef41ff0b4d56024af318b2
librbd: update AioCompletion return value before evaluating pending count

If the pending count is decremented before the return value is updated,
there is a possibility of two ASIO threads concurrently decrementing the
pending count down from 2 -> 1 -> 0. In the second thread (the one that
performs the final decrement from 1 -> 0), it can finalize the completion
before the first thread has had a chance to update the return value.

Fixes: https://tracker.ceph.com/issues/47847
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/io/AioCompletion.cc