]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop osd_lock during scrub 28330/head
authorSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 15:51:57 +0000 (10:51 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 15:51:57 +0000 (10:51 -0500)
We do not want to hold osd_lock while calling apply_transaction or else
we may cause a deadlock due to a completion event that needs osd_lock.

Also, we don't need to hold the lock here, so don't.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 86ce5101158fbb474af9633c99bfa0b8be835784..650adc9ca264dbbe589998b1e204c45840367e22 100644 (file)
@@ -6635,7 +6635,12 @@ void OSD::scrub_purged_snaps()
   SnapMapper::Scrubber s(cct, store, service.meta_ch,
                         make_snapmapper_oid());
   clog->debug() << "purged_snaps scrub starts";
+  osd_lock.unlock();
   s.run();
+  osd_lock.lock();
+  if (is_stopping()) {
+    return;
+  }
   if (s.stray.size()) {
     clog->debug() << "purged_snaps scrub find " << s.stray.size() << " strays";
   } else {