From: Julien COLLET Date: Fri, 16 Feb 2018 15:25:47 +0000 (+0100) Subject: librbd: disallow creation of v1 image format X-Git-Tag: v13.1.0~422^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bf336ebcb6b59d57bbea042cbd3a72448e91955;p=ceph.git librbd: disallow creation of v1 image format V1 image format has been deprecated since the jewel release, so forbit it. However some internal test cases still need v1 images so allow their creation if the RBD_FORCE_ALLOW_V1 env var is set. Signed-off-by: Julien Collet --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 6141f6e2b603..bedabe439779 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -869,6 +869,11 @@ bool compare_by_name(const child_info_t& c1, const child_info_t& c2) } if (old_format) { + if ( !getenv("RBD_FORCE_ALLOW_V1") ) { + lderr(cct) << "Format 1 image creation unsupported. " << dendl; + return -EINVAL; + } + lderr(cct) << "Forced V1 image creation. " << dendl; r = create_v1(io_ctx, image_name.c_str(), size, order); } else { ThreadPool *thread_pool;