]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
RadosModel: use sharedptr_registry for snaps_in_use
authorSamuel Just <sam.just@inktank.com>
Tue, 5 Nov 2013 23:40:29 +0000 (15:40 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 6 Nov 2013 02:00:04 +0000 (18:00 -0800)
commita3ccd29716af900be265b6f995eb4069b334c516
tree34b42922dd64906cbb86bcc45b5dadbb4150a0a7
parent154ee0b0345482bdfdeb84b7d3b00dba71577d97
RadosModel: use sharedptr_registry for snaps_in_use

There might be two concurrent rollback ops each of which
adds snap x to snaps_in_use.  Between when the first
completes and the second completes, snap x may be removed
since the first would have removed snap x from snaps_in_use.
Using sharedptr_registry here avoids this by ensuring that
the snap won't be removed from snaps_in_use until all refs
are gone.

This patch also adds size() to sharedptr_registry.

Fixes: #6719
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
src/common/sharedptr_registry.hpp
src/test/osd/RadosModel.h
src/test/osd/TestRados.cc