]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: generate image cache state json under m_lock 47940/head
authorIlya Dryomov <idryomov@gmail.com>
Thu, 18 Aug 2022 16:48:39 +0000 (18:48 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sat, 3 Sep 2022 10:36:30 +0000 (12:36 +0200)
commit54d470d8f0865ce4b5ac149a46f787215110e0b9
treea85d598b09df4a5a67b4c68b1855e1969bdf28a6
parent2bd305811e88db7a99ae5e2dc76219e0f8265f93
librbd/cache/pwl: generate image cache state json under m_lock

The previous commit moved the entirety of write_image_cache_state()
from under m_lock.  This was a step too far because the generated image
cache state json is no longer guaranteed to be consistent.

Arrange for m_lock to still be held during image cache json generation
but released before owner_lock is grabbed.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit ad504b10f60290cc7461ea96eaada1fb3f7639d7)
src/librbd/cache/pwl/AbstractWriteLog.cc
src/librbd/cache/pwl/AbstractWriteLog.h
src/librbd/cache/pwl/ImageCacheState.cc
src/librbd/cache/pwl/ImageCacheState.h
src/librbd/cache/pwl/rwl/WriteLog.cc
src/librbd/cache/pwl/ssd/WriteLog.cc
src/test/librbd/cache/pwl/test_mock_ReplicatedWriteLog.cc
src/test/librbd/cache/pwl/test_mock_SSDWriteLog.cc