]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: potential deadlock in PG::_scan_snaps when repairing snap mapper 24833/head
authorMykola Golub <mgolub@suse.com>
Tue, 30 Oct 2018 08:36:58 +0000 (10:36 +0200)
committerMykola Golub <mgolub@suse.com>
Sun, 11 Nov 2018 07:38:03 +0000 (09:38 +0200)
Using apply_transaction when holding the pg lock is not safe.

It was fixed in master (mimic) during os, osd refactoring, and this
commit is a partial backport of 907b6281e99ece3677dd7b012cf4955731db6120.

Fixes: http://tracker.ceph.com/issues/36630
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/osd/PG.cc

index 6581cc2988b9eca7872d20be9bbbcb340711649e..2ea67e1c634d0d26f34d6c31701bbab0cc1cf3b0 100644 (file)
@@ -4347,7 +4347,7 @@ void PG::_scan_snaps(ScrubMap &smap)
          bool done;
          t.register_on_applied_sync(
            new C_SafeCond(&my_lock, &my_cond, &done, &r));
-         r = osd->store->apply_transaction(osr.get(), std::move(t));
+         r = osd->store->queue_transaction(osr.get(), std::move(t), nullptr);
          if (r != 0) {
            derr << __func__ << ": apply_transaction got " << cpp_strerror(r)
                 << dendl;