]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/librbd/fsx.cc
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / test / librbd / fsx.cc
index b8be4708e2d01c9b1c8f9dfb46770c4a11c6ade4..94c454bf3c16e4ba6429dfc8cdb256bbda8e35f4 100644 (file)
@@ -1149,6 +1149,8 @@ int
 krbd_resize(struct rbd_ctx *ctx, uint64_t size)
 {
        int ret;
+       int count = 0;
+       uint64_t effective_size;
 
        ceph_assert(size % truncbdy == 0);
 
@@ -1170,7 +1172,29 @@ krbd_resize(struct rbd_ctx *ctx, uint64_t size)
        if (ret < 0)
                return ret;
 
-       return __librbd_resize(ctx, size);
+       ret = __librbd_resize(ctx, size);
+       if (ret < 0)
+               return ret;
+
+       for (;;) {
+               ret = krbd_get_size(ctx, &effective_size);
+               if (ret < 0)
+                       return ret;
+
+               if (effective_size == size)
+                       break;
+
+               if (count++ >= 15) {
+                       prt("BLKGETSIZE64 size error: expected 0x%llx, actual 0x%llx\n",
+                           (unsigned long long)size,
+                           (unsigned long long)effective_size);
+                       return -EINVAL;
+               }
+
+               usleep(count * 250 * 1000);
+       }
+
+       return 0;
 }
 
 int