]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/bluestore: Make Onode::put/get resiliant to split_cache
authorAdam Kupczyk <akupczyk@redhat.com>
Mon, 22 Mar 2021 10:20:11 +0000 (11:20 +0100)
committerAdam Kupczyk <akupczyk@redhat.com>
Mon, 22 Mar 2021 22:19:54 +0000 (23:19 +0100)
commit343b049a1328d39a69a8c4c9e9cb93ac6ac77280
tree1e053694355f193777799b6e31fb7addc8ac854a
parent25bc7023f0c8949e8cbf9fb35124022f6d4f3fb3
os/bluestore: Make Onode::put/get resiliant to split_cache

In
  OnodeCacheShard* ocs = c->get_onode_cache();
  std::lock_guard l(ocs->lock);
while waiting for lock, split_cache might have changed OnodeCacheShard.
This will result in adding Onode to improper OnodeCacheShard.
Such action is obviously bad, as we will operate in future (at least once) on
different OnodeCacheShard then we got lock for. Particulary sensitive to this
are _trim and split_cache functions, as they iterate over elements.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/os/bluestore/BlueStore.cc