]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os: fix threads leak on error exit
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 4 Jan 2016 03:43:12 +0000 (11:43 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 4 Jan 2016 06:11:56 +0000 (14:11 +0800)
Fixes: #14186
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/filestore/FileStore.cc

index 30a97214e1efc98de8bdc756fc536427a516ab0e..d1f0df799b2706f1dbe74bf7a9d88de72649599b 100644 (file)
@@ -1605,16 +1605,7 @@ int FileStore::mount()
             << "wasn't configured?" << dendl;
       }
 
-      // stop sync thread
-      lock.Lock();
-      stop = true;
-      sync_cond.Signal();
-      lock.Unlock();
-      sync_thread.join();
-
-      wbthrottle.stop();
-
-      goto close_current_fd;
+      goto stop_sync;
     }
   }
 
@@ -1623,7 +1614,7 @@ int FileStore::mount()
     if (g_conf->filestore_debug_omap_check && !object_map->check(err2)) {
       derr << err2.str() << dendl;
       ret = -EINVAL;
-      goto close_current_fd;
+      goto stop_sync;
     }
   }
 
@@ -1654,6 +1645,15 @@ int FileStore::mount()
   // all okay.
   return 0;
 
+stop_sync:
+  // stop sync thread
+  lock.Lock();
+  stop = true;
+  sync_cond.Signal();
+  lock.Unlock();
+  sync_thread.join();
+
+  wbthrottle.stop();
 close_current_fd:
   VOID_TEMP_FAILURE_RETRY(::close(current_fd));
   current_fd = -1;