]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerNeha Ojha <nojha@redhat.com>
Fri, 26 Mar 2021 15:57:13 +0000 (15:57 +0000)
commit65a1823aead49830fd81a3303c25ffc24935ad53
tree2cc4086272d424924e5a4bb91b187d32b11597cb
parent14db397c8c913d1587f8d137943fa6139acfa215
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>
(cherry picked from commit 343b049a1328d39a69a8c4c9e9cb93ac6ac77280)
src/os/bluestore/BlueStore.cc