]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librados: fix locking for AioCompletionImpl refcounting
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 13 Aug 2013 02:17:09 +0000 (19:17 -0700)
committerSage Weil <sage@inktank.com>
Wed, 14 Aug 2013 16:54:44 +0000 (09:54 -0700)
commit29ae033b435581a64fc92a26106b4ea1c3dfc0b1
treefd8be2afec69adc1a8221d4ddddadef3dfde0f80
parente3b7bc5bce8ab330ec1661381072368af3c218a0
librados: fix locking for AioCompletionImpl refcounting

Add an already-locked helper so that C_Aio{Safe,Complete} can
increment the reference count when their caller holds the
lock. C_AioCompleteAndSafe's caller is not holding the lock, so call
regular get() to ensure no racing updates can occur.

This eliminates all direct manipulations of AioCompletionImpl->ref,
and makes the necessary locking clear.

The only place C_AioCompleteAndSafe is used is in handling
aio_flush_async(). This could cause a missing completion.

Refs: #5919
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Tested-by: Oliver Francke <Oliver.Francke@filoo.de>
(cherry picked from commit 7a52e2ff5025754f3040eff3fc52d4893cafc389)
src/librados/AioCompletionImpl.h