]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_librbd: close ioctx after imagectx
authorJosh Durgin <jdurgin@redhat.com>
Tue, 24 Feb 2015 22:31:27 +0000 (14:31 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 26 Feb 2015 01:27:33 +0000 (17:27 -0800)
There's no need to explicitly close the ioctx. Doing so may cause
problems when the Images using it are destroyed afterwards.  Just let
normal cleanup at the end of the block take care of it in the correct
order.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/test/librbd/test_librbd.cc

index 10693ef8ae1c8965549248a9183a2487e7025948..abfb4bcf0d4b35a4a9c04812b6be8de1e2461a44 100644 (file)
@@ -2151,7 +2151,6 @@ TEST_F(TestLibRBD, DiffIterateDiscard)
   ASSERT_EQ(1u, extents.size());
   ASSERT_EQ(diff_extent(0, 256, false), extents[0]);
   ASSERT_PASSED(validate_object_map, image);
-  ioctx.close();
 }
 
 TEST_F(TestLibRBD, DiffIterateStress)
@@ -2211,7 +2210,6 @@ TEST_F(TestLibRBD, DiffIterateStress)
   }
 
   ASSERT_PASSED(validate_object_map, image);
-  ioctx.close();
 }
 
 TEST_F(TestLibRBD, DiffIterateRegression6926)
@@ -2252,7 +2250,6 @@ TEST_F(TestLibRBD, DiffIterateRegression6926)
   ASSERT_EQ(0, image.diff_iterate(NULL, 0, size,
                            vector_iterate_cb, (void *) &extents));
   ASSERT_EQ(static_cast<size_t>(0), extents.size());
-  ioctx.close();
 }
 
 TEST_F(TestLibRBD, ZeroLengthWrite)