From b9ec776dffb43587217ed708742ae3c24c847208 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Tue, 30 Oct 2018 10:36:58 +0200 Subject: [PATCH] osd: potential deadlock in PG::_scan_snaps when repairing snap mapper 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 --- src/osd/PG.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6581cc2988b9e..2ea67e1c634d0 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; -- 2.39.5