]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: update AioCompletion return value before evaluating pending count 37851/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 13 Oct 2020 01:34:25 +0000 (21:34 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2020 09:10:44 +0000 (10:10 +0100)
commitd38f2ec9f983a4ec916dc846bca4d844a1a57f69
tree78e5eda702bb027b5c45602c540bdcecae95b4ab
parentb6d6e254979727c5d5ae5386f42bf220a508269a
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>
(cherry picked from commit 94f3bce53c39017028ce44a80697f55af2a82e68)
src/librbd/io/AioCompletion.cc