]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd/cache/pwl: generate image cache state json under m_lock
authorIlya Dryomov <idryomov@gmail.com>
Thu, 18 Aug 2022 16:48:39 +0000 (18:48 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 18 Aug 2022 18:11:12 +0000 (20:11 +0200)
commitad504b10f60290cc7461ea96eaada1fb3f7639d7
tree98cb60542936dffdd42e9bd80dec61027f2e3928
parenta0e2868d9473a9120c4c5d478f6a592859ce1aec
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>
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