]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix watch timer, locking
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 15 Dec 2010 23:22:32 +0000 (15:22 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 15 Dec 2010 23:23:08 +0000 (15:23 -0800)
src/osd/OSD.cc
src/osd/ReplicatedPG.cc

index 5e9af335310686bdb5269eb31a91cb60326f6935..ca0366527b87baf76492c85e0b5eac6cdbc2daf6 100644 (file)
@@ -459,6 +459,7 @@ int OSD::init()
   Mutex::Locker lock(osd_lock);
 
   timer.init();
+  watch_timer.init();
   watch = new Watch();
 
   // mount.
@@ -654,6 +655,10 @@ int OSD::shutdown()
 
   timer.shutdown();
 
+  watch_lock.Lock();
+  watch_timer.shutdown();
+  watch_lock.Unlock();
+
   heartbeat_lock.Lock();
   heartbeat_stop = true;
   heartbeat_cond.Signal();
@@ -1757,7 +1762,8 @@ void OSD::handle_notify_timeout(void *_notif)
   ReplicatedPG *pg = (ReplicatedPG *)lookup_lock_raw_pg(notif->pgid);
   pg_t pgid = notif->pgid;
   pg->do_complete_notify(notif, obc);
-  put_object_context(obc, notif->pgid);
+  pg->put_object_context(obc);
+  pg->unlock();
   
   watch_lock.Lock();
   /* exiting with watch_lock held */
index 555e34144cf2887803696ba7a88354aea043372c..eae2d8d42486910eb02f93b12eb39e5e9e6e27c8 100644 (file)
@@ -1222,6 +1222,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
 
        Watch::Notification *notif = osd->watch->get_notif(op.watch.cookie);
        if (!notif) {
+          osd->watch_lock.Unlock();
          result = -EINVAL;
          break;
        }