From: Jason Dillaman Date: Mon, 28 Mar 2016 19:39:00 +0000 (-0400) Subject: rbd-mirror: use 32bit image creation bid to avoid overflow X-Git-Tag: v10.1.1~64^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9665b5b276d1573f2d40cd9c3193d2f59031c24a;p=ceph.git rbd-mirror: use 32bit image creation bid to avoid overflow Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc index 55795467b378..92f98c0d1be0 100644 --- a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc @@ -64,8 +64,12 @@ struct C_CreateImage : public Context { uint64_t journal_splay_width = cct->_conf->rbd_journal_splay_width; std::string journal_pool = cct->_conf->rbd_journal_pool; - r = librbd::create_v2(local_io_ctx, local_image_name.c_str(), - reinterpret_cast(this), + // NOTE: bid is 64bit but overflow will result due to + // RBD_MAX_BLOCK_NAME_SIZE being too small + librados::Rados rados(local_io_ctx); + uint64_t bid = rados.get_instance_id(); + + r = librbd::create_v2(local_io_ctx, local_image_name.c_str(), bid, remote_image_ctx->size, order, remote_image_ctx->features, remote_image_ctx->stripe_unit,