]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: handle bnode removal race
authorSage Weil <sage@redhat.com>
Wed, 22 Jun 2016 19:00:48 +0000 (15:00 -0400)
committerSage Weil <sage@redhat.com>
Wed, 22 Jun 2016 19:08:36 +0000 (15:08 -0400)
commit3064c819fdf6e4592061f9ef2eaf723b035fabea
treeb55d1c733d142d2af53dc610e6f04c76d3e72f52
parent7c6bdb0e213df7875b1b88599b865378dbd6106a
os/bluestore: handle bnode removal race

One thread might try to drop a bnode while another does a lookup and
retakes a ref:

 1- drop bnode ref (-> 0)
 2- take bnode_set lock, do lookup
 2- take bnode ref (-> 1)
 2- drop lock
 1- take bnode_set lock
 1- remove from set
 1- drop lock

Fix this race by rechecking the ref count while we are holding the lock.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h