]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: disallow creation of v1 image format
authorJulien COLLET <julien.collet@cern.ch>
Fri, 16 Feb 2018 15:25:47 +0000 (16:25 +0100)
committerJulien COLLET <julien.collet@cern.ch>
Thu, 1 Mar 2018 13:18:08 +0000 (14:18 +0100)
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 <julien.collet@cern.ch>
src/librbd/internal.cc

index 6141f6e2b6034bbc132079404d2c38f70d524c6e..bedabe4397795fe102aea53635de95c775dab295 100644 (file)
@@ -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;