Project

General

Profile

Actions

Bug #56703

closed

[pwl] AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock ordering

Added by Ilya Dryomov almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
backport_processed
Backport:
pacific,quincy
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock ordering

AbstractWriteLog::periodic_stats() takes m_lock and ends up calling AbstractWriteLog::write_image_cache_state():

periodic_stats
  update_image_cache_state
    update_image_cache_state(Context*)
      write_image_cache_state

write_image_cache_state() takes owner_lock, so we have m_lock -> owner_lock order.

SnapshotCreateRequest::handle_notify_quiesce() takes owner_lock and ends up executing GuardedRequestFunctionContext callback:

handle_notify_quiesce
  send_suspend_requests
    send_suspend_aio
      WriteBlockImageDispatch::block_writes
        WriteBlockImageDispatch::flush_io
          ImageDispatchSpec::send
            ...
              WriteLogImageDispatch::flush
                AbstractWriteLog::flush
                  internal_flush
                    detain_guarded_request
                      Context::complete
                        GuardedRequestFunctionContext::finish

The callback may take m_lock, e.g. one defined in AbstractWriteLog::flush() or in AbstractWriteLog::internal_flush(), so we have owner_lock -> m_lock order.


Related issues 2 (0 open2 closed)

Copied to rbd - Backport #57211: pacific: [pwl] AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock orderingResolvedIlya DryomovActions
Copied to rbd - Backport #57212: quincy: [pwl] AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock orderingResolvedIlya DryomovActions
Actions

Also available in: Atom PDF