Project

General

Profile

Bug #56703

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

Added by Ilya Dryomov over 1 year ago. Updated about 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

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

History

#1 Updated by Ilya Dryomov over 1 year ago

  • Assignee set to CONGMIN YIN

Hi Congmin,

I'm assigning this to you since you worked on periodic_stats() recently, let me know if somebody else would be taking this. I suspect m_lock -> owner_lock order is incorrect and needs to be fixed.

#2 Updated by CONGMIN YIN over 1 year ago

ok, will do.

#3 Updated by CONGMIN YIN over 1 year ago

  • Pull request ID set to 47325

#4 Updated by Ilya Dryomov over 1 year ago

  • Status changed from New to Fix Under Review

#5 Updated by Ilya Dryomov over 1 year ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to pacific,quincy

#6 Updated by Backport Bot over 1 year ago

  • Copied to Backport #57211: pacific: [pwl] AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock ordering added

#7 Updated by Backport Bot over 1 year ago

  • Copied to Backport #57212: quincy: [pwl] AbstractWriteLog::m_lock vs ImageCtx::owner_lock lock ordering added

#8 Updated by Backport Bot over 1 year ago

  • Tags set to backport_processed

#9 Updated by Backport Bot about 1 year ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF