]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: rebuild exclusive lock test should acquire exclusive lock 7038/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 23 Dec 2015 15:31:07 +0000 (10:31 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 23 Dec 2015 15:31:07 +0000 (10:31 -0500)
Starting with Jewel, the object map will not be loaded until the
exclusive lock is acquired since it might be updated by the
lock owner.

Fixes: #14121
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_librbd.cc

index 689e285267bd2adf01d1d7a56eb24cd42a1fb6de..09eeb6595b751223608ded4043f156ba892460b9 100644 (file)
@@ -3059,6 +3059,12 @@ TEST_F(TestLibRBD, RebuildObjectMap)
   librbd::Image image1;
   ASSERT_EQ(0, rbd.open(ioctx, image1, name.c_str(), NULL));
 
+  bool lock_owner;
+  bl.clear();
+  ASSERT_EQ(0, image1.write(0, 0, bl));
+  ASSERT_EQ(0, image1.is_exclusive_lock_owner(&lock_owner));
+  ASSERT_TRUE(lock_owner);
+
   uint64_t flags;
   ASSERT_EQ(0, image1.get_flags(&flags));
   ASSERT_TRUE((flags & RBD_FLAG_OBJECT_MAP_INVALID) != 0);