]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: protect recovery_wq ops with the recovery lock
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 27 May 2011 19:55:22 +0000 (12:55 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 30 May 2011 19:37:42 +0000 (12:37 -0700)
We were calling recovery_item.remove_myself() without holding the
recoveryWQ::lock. Naughty naughty!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/osd/OSD.cc
src/osd/PG.h

index 5d6ca78a10ae59b744a62074508ae7f8c0fbbda1..32f505f1441e2c52c31bbe4e3ffbffa23b3750e9 100644 (file)
@@ -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();
   }
index 985cd95fec3d63e6a625066f813d357bc2779bb2..324dcc96d15a2d945baf233a7e9ac2c261f417c8 100644 (file)
@@ -787,6 +787,8 @@ public:
 
   interval_set<snapid_t> snap_trimq;
 
+  /* You should not use these items without taking their respective queue locks
+   * (if they have one) */
   xlist<PG*>::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