]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: do not expose non-public symbols 13265/head
authorKefu Chai <kchai@redhat.com>
Sun, 5 Feb 2017 15:24:49 +0000 (23:24 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 5 Feb 2017 15:33:53 +0000 (23:33 +0800)
librados could be referencing the wrong symbol when calling the
destructor. for example, a variable of type AioGetxattrsData in
IoCtxImpl.cc) could be destructed using the destructor defined in
librados.cc. this is reproduciable using

ceph_test_rados_api_aio --gtest_filter=LibRadosAio.XattrIter

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librados/IoCtxImpl.cc
src/librados/librados.cc

index f045228116cb0b2254329e7eac2e6aee0df54348..238e3c67069dbf680ebd841338ae6134e4bfe64f 100644 (file)
@@ -1133,6 +1133,7 @@ int librados::IoCtxImpl::aio_setxattr(const object_t& oid, AioCompletionImpl *c,
   return aio_operate(oid, &op, c, snapc, 0);
 }
 
+namespace {
 struct AioGetxattrsData {
   AioGetxattrsData(librados::AioCompletionImpl *c, map<string, bufferlist>* attrset,
                   librados::RadosClient *_client) :
@@ -1142,6 +1143,7 @@ struct AioGetxattrsData {
   map<std::string, bufferlist>* user_attrset;
   librados::RadosClient *client;
 };
+}
 
 static void aio_getxattrs_complete(rados_completion_t c, void *arg) {
   AioGetxattrsData *cdata = reinterpret_cast<AioGetxattrsData*>(arg);
index ba2104139c0d37465ef44b7480bef7215a432aea..7b9816b4efa4917069df598b966c5f5fba1feabf 100644 (file)
@@ -4735,6 +4735,7 @@ extern "C" int rados_aio_getxattr(rados_ioctx_t io, const char *o,
   return ret;
 }
 
+namespace {
 struct AioGetxattrsData {
   AioGetxattrsData(rados_completion_t c, rados_xattrs_iter_t *_iter) :
     iter(_iter), user_completion((librados::AioCompletionImpl*)c) {
@@ -4747,6 +4748,7 @@ struct AioGetxattrsData {
   rados_xattrs_iter_t *iter;
   struct librados::C_AioCompleteAndSafe user_completion;
 };
+}
 
 static void rados_aio_getxattrs_complete(rados_completion_t c, void *arg) {
   AioGetxattrsData *cdata = reinterpret_cast<AioGetxattrsData*>(arg);