]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: pool async create / delete does not delete completion handle
authorYehuda Sadeh <yehuda@inktank.com>
Mon, 30 Sep 2013 22:40:02 +0000 (15:40 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 30 Sep 2013 22:40:02 +0000 (15:40 -0700)
Backport: dumpling
The pool async delete / create function used to delete the internal
completion object. However, caller still holds the allocated completion
object, which it can't drop a reference to (as it'd try to deallocate
the already freed internal object). This fix removes the internal object
deletion, a following commit will fix a related leak (#6444) by having
the application (radosgw) drop the reference even if got an error.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/librados/RadosClient.cc

index 8a5f499ec15260b0802e726a24bcfc4c8ba7bdf0..1be3ebd10f902fd502061a7ecd35b105145d9cde 100644 (file)
@@ -459,7 +459,6 @@ int librados::RadosClient::pool_create_async(string& name, PoolAsyncCompletionIm
   Context *onfinish = new C_PoolAsync_Safe(c);
   int r = objecter->create_pool(name, onfinish, auid, crush_rule);
   if (r < 0) {
-    delete c;
     delete onfinish;
   }
   return r;
@@ -505,7 +504,6 @@ int librados::RadosClient::pool_delete_async(const char *name, PoolAsyncCompleti
   Context *onfinish = new C_PoolAsync_Safe(c);
   int r = objecter->delete_pool(tmp_pool_id, onfinish);
   if (r < 0) {
-    delete c;
     delete onfinish;
   }
   return r;