]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Objecter: check the 'initialized' atomic_t safely 4096/head
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 30 Sep 2014 01:17:29 +0000 (18:17 -0700)
committerLoic Dachary <ldachary@redhat.com>
Thu, 19 Mar 2015 09:44:18 +0000 (10:44 +0100)
commitd790833cb84d6f6349146e4f9abdcdffb4db2ee0
tree1e8e0b6894ac78acd7a03d91bb02e3d994e2d639
parentce436a33e0f720ea4b8cf0363bcac1126be3c28b
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>
(cherry picked from commit e506f896a9217324ab7a7865989f4454562aed5f)

Conflicts:
src/osdc/Objecter.cc
        context changed: Objecter::tick() did not have
        assert(initialized.read())
src/osdc/Objecter.cc