]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: validate journal object max size 25955/head
authorMykola Golub <mgolub@suse.com>
Wed, 2 Jan 2019 13:31:14 +0000 (13:31 +0000)
committerPrashant D <pdhange@redhat.com>
Tue, 15 Jan 2019 05:43:47 +0000 (00:43 -0500)
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit bc08dfb8b364a60b3c35dbacde5a0da95133d1b5)

Conflicts:
src/test/cli/rbd/help.t : Removed deep copy and migration text

src/common/options.cc
src/test/cli/rbd/help.t
src/tools/rbd/ArgumentTypes.cc

index 231a7651b17f9377acd368a9192c57c2b6eef553..604bc0541d824819d19eb257b58b030da0cf6d79 100644 (file)
@@ -5978,7 +5978,7 @@ static std::vector<Option> get_rbd_options() {
     .set_description("default krbd map options"),
 
     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 06cfa294f814be5e4229a0fc64f22ebef87cf01c..25b484bbaaa80f94aa4d49b286145eb931c99c78 100644 (file)
@@ -182,7 +182,7 @@ Skip test on FreeBSD as it generates different output there.
     --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:
@@ -229,7 +229,7 @@ Skip test on FreeBSD as it generates different output there.
     --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
@@ -274,7 +274,7 @@ Skip test on FreeBSD as it generates different output there.
     --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
     -s [ --size ] arg         image size (in M/G/T) [default: M]
   
@@ -406,7 +406,7 @@ Skip test on FreeBSD as it generates different output there.
     -p [ --pool ] arg         pool 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
@@ -527,7 +527,7 @@ Skip test on FreeBSD as it generates different output there.
     --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
index 1798e205f7958d3cd206151aea5a89ee7136d78f..d7093ac852d7b3739542136f2bf1526112b733d2 100644 (file)
@@ -292,7 +292,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");
 }
@@ -506,7 +506,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;
   }