]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
Objecter: check the 'initialized' atomic_t safely 2621/head
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 30 Sep 2014 01:17:29 +0000 (18:17 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 1 Oct 2014 21:05:17 +0000 (14:05 -0700)
commite506f896a9217324ab7a7865989f4454562aed5f
treeec626266c2c031c3becf770b5b686817f44833e4
parent1feba200aae7d9a042cda705c3de8fba2fc82331
Objecter: check the 'initialized' atomic_t safely

shutdown() resets initialized to 0, but we can still receive messages
after this point, so fix message handlers to skip messages in this
case instead of asserting.

Also read initialized while holding Objecter::rwlock to avoid races
where e.g. handle_osd_map() checks initialized -> 1, continues,
shutdown() is called, sets initialized to 0, then handle_osd_map()
goes about its business and calls op_submit(), which would fail the
assert(initialized.read()) check. Similar races existed in other
message handlers which change Objecter state.

The Objecter is not destroyed until after its Messenger in
the MDS, OSD, and librados, so this should be safe.

Fixes: #9617
Backport: giant
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/osdc/Objecter.cc