]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados_test_stub: add IoCtx::{set,get}_pool_full_try() stubs
authorIlya Dryomov <idryomov@gmail.com>
Sun, 17 Oct 2021 11:09:14 +0000 (13:09 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 17 Oct 2021 15:24:41 +0000 (17:24 +0200)
Because unittest_librbd links not just with librados_test_stub.a but
also with librados.so (why?), these were sneakily picked up from the
latter.  This resulted in get_pool_full_try() reading from invalid
memory and every once in a while returning true, prompting librbd to
write to invalid memory through set_pool_full_try() in create_ioctx()
and cause random crashes.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/test/librados_test_stub/LibradosTestStub.cc

index b5ceb53eae92b973a12b3f841688f0e2a242cba8..9e430057faabcbccf70e0b78417957923d484e23 100644 (file)
@@ -791,6 +791,13 @@ std::string IoCtx::get_namespace() const {
   return ctx->get_namespace();
 }
 
+void IoCtx::set_pool_full_try() {
+}
+
+bool IoCtx::get_pool_full_try() {
+  return false;
+}
+
 static int save_operation_result(int result, int *pval) {
   if (pval != NULL) {
     *pval = result;