mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
Merge pull request #17992 from dillaman/wip-21558
librbd: hold cache_lock while clearing cache nonexistence flags Reviewed-by: Mykola Golub <to.my.trociny@gmail.com>
This commit is contained in:
commit
2665d4448e
@ -69,12 +69,13 @@ void RefreshParentRequest<I>::send() {
|
||||
|
||||
template <typename I>
|
||||
void RefreshParentRequest<I>::apply() {
|
||||
assert(m_child_image_ctx.cache_lock.is_locked());
|
||||
assert(m_child_image_ctx.snap_lock.is_wlocked());
|
||||
assert(m_child_image_ctx.parent_lock.is_wlocked());
|
||||
if (m_child_image_ctx.parent != nullptr) {
|
||||
// closing parent image
|
||||
m_child_image_ctx.clear_nonexistence_cache();
|
||||
}
|
||||
assert(m_child_image_ctx.snap_lock.is_wlocked());
|
||||
assert(m_child_image_ctx.parent_lock.is_wlocked());
|
||||
std::swap(m_child_image_ctx.parent, m_parent_image_ctx);
|
||||
}
|
||||
|
||||
|
@ -326,6 +326,7 @@ int SetSnapRequest<I>::apply() {
|
||||
ldout(cct, 10) << __func__ << dendl;
|
||||
|
||||
RWLock::WLocker owner_locker(m_image_ctx.owner_lock);
|
||||
Mutex::Locker cache_locker(m_image_ctx.cache_lock);
|
||||
RWLock::WLocker snap_locker(m_image_ctx.snap_lock);
|
||||
RWLock::WLocker parent_locker(m_image_ctx.parent_lock);
|
||||
if (m_snap_id != CEPH_NOSNAP) {
|
||||
|
Loading…
Reference in New Issue
Block a user