Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: osd: crash in OpTracker::unregister_inflight_op via OSD::get_health_metrics #23026

Merged
merged 1 commit into from
Oct 17, 2018

Commits on Jul 13, 2018

  1. common: fix races when visiting a TrackedOp.

    Before the commit following race can happen:
      ```
      A           : OpTracker::visit_ops_in_flight(..., callable leaking TrackedOpRef outside)
      A           : Mutex::Locker::Locker(sdata->ops_in_flight_lock_sharded)
      A with lock : (nref > 0) == true
    
      B           : TrackedOp::put(), nref := 0 // updating the counter is done without the lock
      B           : OpTracker::unregister_inflight_op()
      B           : Mutex::Locker::Locker(sdata->ops_in_flight_lock_sharded)
    
      A with lock : visit() -> TrackedOp::get(), nref := 1
      A with lock : Mutex::Locker::~Locker()
    
      B with lock : boost::intrusive::list::iterator_to(op)
      B with lock : boost::intrusive::list::erase(iter)
      B with lock : Mutex::Locker::~Locker()
    
      A           : TrackedOp::put(), nref := 0
      A           : OpTracker::unregister_inflight_op()
      A           : Mutex::Locker::Locker(sdata->ops_in_flight_lock_sharded)
      A with lock : boost::intrusive::list::iterator_to(op) // oops as op doesn't belong to the list anymore
      ```
    
    Fixes: https://tracker.ceph.com/issues/24664
    Related-To: https://tracker.ceph.com/issues/24037
    Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
    (cherry picked from commit 871cbf0)
    rzarzynski authored and smithfarm committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    4cee819 View commit details
    Browse the repository at this point in the history