From: Greg Farnum Date: Fri, 27 May 2011 19:55:22 +0000 (-0700) Subject: osd: protect recovery_wq ops with the recovery lock X-Git-Tag: v0.29~12^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b7c8ae8bdc26e7593323c76527cb37912b9d833;p=ceph.git osd: protect recovery_wq ops with the recovery lock We were calling recovery_item.remove_myself() without holding the recoveryWQ::lock. Naughty naughty! Signed-off-by: Greg Farnum --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 5d6ca78a10a..32f505f1441 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4790,11 +4790,17 @@ void OSD::do_recovery(PG *pg) do_queries(query_map); else { dout(10) << "do_recovery no luck, giving up on this pg for now" << dendl; + recovery_wq.lock(); pg->recovery_item.remove_myself(); // sigh... + recovery_wq.unlock(); + } } - else if (started < max) + else if (started < max) { + recovery_wq.lock(); pg->recovery_item.remove_myself(); + recovery_wq.unlock(); + } pg->unlock(); } diff --git a/src/osd/PG.h b/src/osd/PG.h index 985cd95fec3..324dcc96d15 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -787,6 +787,8 @@ public: interval_set snap_trimq; + /* You should not use these items without taking their respective queue locks + * (if they have one) */ xlist::item recovery_item, backlog_item, scrub_item, scrub_finalize_item, snap_trim_item, remove_item, stat_queue_item; int recovery_ops_active; #ifdef DEBUG_RECOVERY_OIDS