]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix MDLog I/O callback without finisher
authorJohn Spray <john.spray@redhat.com>
Thu, 20 Nov 2014 14:27:27 +0000 (14:27 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 1 Dec 2014 12:09:13 +0000 (12:09 +0000)
This could deadlock if another caller was waiting
on a write_head callback while holding mds_lock.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDLog.cc

index 0beb6d68f206931b6901de352f905aa6de489058..836db4730d8de3159c550bbdb5901f9b19b3d068 100644 (file)
@@ -101,9 +101,9 @@ class C_MDL_WriteError : public MDSIOContextBase {
 
 void MDLog::write_head(MDSInternalContextBase *c) 
 {
-  MDSIOContext *fin = NULL;
+  C_OnFinisher *fin = NULL;
   if (c != NULL) {
-    fin = new C_IO_Wrapper(mds, c);
+    fin = new C_OnFinisher(new C_IO_Wrapper(mds, c), &(mds->finisher));
   }
   journaler->write_head(fin);
 }