From: songweibin Date: Mon, 28 Aug 2017 08:50:58 +0000 (+0800) Subject: librbd: cannot set self as remote peer X-Git-Tag: v13.0.1~1011^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1dd597b1587b57a4e72edc258639db356818b8fa;p=ceph.git librbd: cannot set self as remote peer Signed-off-by: songweibin --- diff --git a/src/librbd/api/Mirror.cc b/src/librbd/api/Mirror.cc index 8661e7a73a35..5b63e0f83c03 100644 --- a/src/librbd/api/Mirror.cc +++ b/src/librbd/api/Mirror.cc @@ -765,6 +765,11 @@ int Mirror::peer_set_cluster(librados::IoCtx& io_ctx, ldout(cct, 20) << "uuid=" << uuid << ", " << "cluster=" << cluster_name << dendl; + if (cct->_conf->cluster == cluster_name) { + lderr(cct) << "cannot set self as remote peer" << dendl; + return -EINVAL; + } + int r = cls_client::mirror_peer_set_cluster(&io_ctx, uuid, cluster_name); if (r < 0) { lderr(cct) << "failed to update cluster '" << uuid << "': "