From 8bf336ebcb6b59d57bbea042cbd3a72448e91955 Mon Sep 17 00:00:00 2001 From: Julien COLLET Date: Fri, 16 Feb 2018 16:25:47 +0100 Subject: [PATCH] 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 --- src/librbd/internal.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 6141f6e2b6034..bedabe4397795 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; -- 2.39.5