]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rbd: don't use read API for write-like methods 61471/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 21 Jan 2025 20:07:08 +0000 (21:07 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 21 Jan 2025 20:24:05 +0000 (21:24 +0100)
This is a follow-up for commit af176311c476 (objclass: change objclass
exec read calls to write ones where needed) which missed mirror_uuid_set
and raced with the addition of mirror_remote_namespace_set.

Fixes: https://tracker.ceph.com/issues/65889
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/cls/rbd/cls_rbd_client.cc

index bc98e427cb0c0fe2c22a174e06342221493de33c..54fad9b7d253c2566367fdd8e7b81a056dbdcef2 100644 (file)
@@ -1819,9 +1819,9 @@ int mirror_uuid_set(librados::IoCtx *ioctx, const std::string &uuid) {
   bufferlist in_bl;
   encode(uuid, in_bl);
 
-  bufferlist out_bl;
-  int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_uuid_set", in_bl,
-                      out_bl);
+  librados::ObjectWriteOperation op;
+  op.exec("rbd", "mirror_uuid_set", in_bl);
+  int r = ioctx->operate(RBD_MIRRORING, &op);
   if (r < 0) {
     return r;
   }
@@ -1907,9 +1907,9 @@ int mirror_remote_namespace_set(librados::IoCtx *ioctx,
   bufferlist in_bl;
   encode(mirror_namespace, in_bl);
 
-  bufferlist out_bl;
-  int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_remote_namespace_set",
-                      in_bl, out_bl);
+  librados::ObjectWriteOperation op;
+  op.exec("rbd", "mirror_remote_namespace_set", in_bl);
+  int r = ioctx->operate(RBD_MIRRORING, &op);
   if (r < 0) {
     return r;
   }