]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd: validate journal object max size
authorMykola Golub <mgolub@suse.com>
Wed, 2 Jan 2019 13:31:14 +0000 (13:31 +0000)
committerMykola Golub <mgolub@suse.com>
Thu, 3 Jan 2019 11:36:50 +0000 (11:36 +0000)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/common/options.cc
src/test/cli/rbd/help.t
src/tools/rbd/ArgumentTypes.cc

index db52824a4e8d147f75b1993ac5c9f374fd61c84f..e6ea2aee18f935df99b69f652ba824c9a98073f1 100644 (file)
@@ -6940,7 +6940,7 @@ static std::vector<Option> get_rbd_options() {
     .set_flag(Option::FLAG_RUNTIME),
 
     Option("rbd_journal_order", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
-    .set_min(12)
+    .set_min_max(12, 26)
     .set_default(24)
     .set_description("default order (object size) for journal data objects"),
 
index 84e0fbdacd80b46c4305f516c0c8836010de6d47..4f28b67438f0c71e6a83260ab12a807419f5e273 100644 (file)
     --stripe-count arg        stripe count
     --data-pool arg           data pool
     --journal-splay-width arg number of active journal objects
-    --journal-object-size arg size of journal objects
+    --journal-object-size arg size of journal objects [4K <= size <= 64M]
     --journal-pool arg        pool for journal objects
   
   Image Features:
     --stripe-count arg           stripe count
     --data-pool arg              data pool
     --journal-splay-width arg    number of active journal objects
-    --journal-object-size arg    size of journal objects
+    --journal-object-size arg    size of journal objects [4K <= size <= 64M]
     --journal-pool arg           pool for journal objects
     --sparse-size arg            sparse size in B/K/M [default: 4K]
     --no-progress                disable progress output
     --stripe-count arg        stripe count
     --data-pool arg           data pool
     --journal-splay-width arg number of active journal objects
-    --journal-object-size arg size of journal objects
+    --journal-object-size arg size of journal objects [4K <= size <= 64M]
     --journal-pool arg        pool for journal objects
     --thick-provision         fully allocate storage and zero image
     -s [ --size ] arg         image size (in M/G/T) [default: M]
     --stripe-count arg           stripe count
     --data-pool arg              data pool
     --journal-splay-width arg    number of active journal objects
-    --journal-object-size arg    size of journal objects
+    --journal-object-size arg    size of journal objects [4K <= size <= 64M]
     --journal-pool arg           pool for journal objects
     --flatten                    fill clone with parent data (make it independent)
     --no-progress                disable progress output
     --namespace arg           namespace name
     --image arg               image name
     --journal-splay-width arg number of active journal objects
-    --journal-object-size arg size of journal objects
+    --journal-object-size arg size of journal objects [4K <= size <= 64M]
     --journal-pool arg        pool for journal objects
   
   rbd help flatten
     --stripe-count arg        stripe count
     --data-pool arg           data pool
     --journal-splay-width arg number of active journal objects
-    --journal-object-size arg size of journal objects
+    --journal-object-size arg size of journal objects [4K <= size <= 64M]
     --journal-pool arg        pool for journal objects
     --sparse-size arg         sparse size in B/K/M [default: 4K]
     --no-progress             disable progress output
     --stripe-count arg        stripe count
     --data-pool arg           data pool
     --journal-splay-width arg number of active journal objects
-    --journal-object-size arg size of journal objects
+    --journal-object-size arg size of journal objects [4K <= size <= 64M]
     --journal-pool arg        pool for journal objects
     --flatten                 fill clone with parent data (make it independent)
   
index 6b4ea3af67413f7269ee2825c439403d9c4b42e6..62039200bb3339bcafded2825417836f80e6d173 100644 (file)
@@ -252,7 +252,7 @@ void add_create_journal_options(po::options_description *opt) {
     (JOURNAL_SPLAY_WIDTH.c_str(), po::value<uint64_t>(),
      "number of active journal objects")
     (JOURNAL_OBJECT_SIZE.c_str(), po::value<JournalObjectSize>(),
-     "size of journal objects")
+     "size of journal objects [4K <= size <= 64M]")
     (JOURNAL_POOL.c_str(), po::value<std::string>(),
      "pool for journal objects");
 }
@@ -480,7 +480,7 @@ void validate(boost::any& v, const std::vector<std::string>& values,
 
   std::string parse_error;
   uint64_t size = strict_iecstrtoll(s.c_str(), &parse_error);
-  if (parse_error.empty() && (size >= (1 << 12))) {
+  if (parse_error.empty() && (size >= (1 << 12)) && (size <= (1 << 26))) {
     v = boost::any(size);
     return;
   }