]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: fix flush_commit locking 22904/head
authorSage Weil <sage@redhat.com>
Fri, 18 May 2018 14:18:11 +0000 (09:18 -0500)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 6 Jul 2018 13:39:23 +0000 (16:39 +0300)
commit9fb89163f0711a719d003309cf27286ac0ff1305
treeba42162564053fa0f4704cf24bccbe50d8c6b240
parentb199fb51f22ae1ae26d4a0da8b1e7dd9ddbe4e99
os/bluestore: fix flush_commit locking

We were updating the txc state to KV_DONE and queuing the oncommits
waiters without holding any locks.  This was mostly fine, *except* that
Collection|OpSequencer::flush_commit(Context *) was looking at the state
(under qlock) and also adding items to oncommits.

The flush_commit() method is only used in 2 places: osd bench, and the
PG reset_interval_flush outgoing message blocking machinery (which is
a bit ick). The first we could get rid of, but the second is hard to
remove (despite its ick factor).

The simple fix is to take qlock while updating the state value and
working with oncommits.

Fixes: http://tracker.ceph.com/issues/21480
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a4042d51bcf1444350fa21763003e57aca984f87)

Conflicts:
    src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.cc