]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust data sync async notification locking
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 15 Feb 2016 22:50:48 +0000 (14:50 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 15 Feb 2016 22:50:48 +0000 (14:50 -0800)
This is a workaround to avoid issues related to the way lockdep works

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_data_sync.cc

index abd1a770cadcf4ef9a98149a2294d51ad9ebc2c0..c822d2d39958ad62a1096a86ff9d383a004a7164 100644 (file)
@@ -1138,12 +1138,23 @@ public:
   }
 
   void wakeup(int shard_id, set<string>& keys) {
-    Mutex::Locker l(cr_lock());
+    Mutex& m = cr_lock();
 
+    m.Lock();
     RGWDataSyncCR *cr = static_cast<RGWDataSyncCR *>(get_cr());
+    if (!cr) {
+      m.Unlock();
+      return;
+    }
+
+    cr->get();
+    m.Unlock();
+
     if (cr) {
       cr->wakeup(shard_id, keys);
     }
+
+    cr->put();
   }
 };