]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix max-size-kb REST quota parameter and add max-size 25448/head
authorNick Erdmann <n.erdmann@itc.rwth-aachen.de>
Mon, 24 Sep 2018 10:48:57 +0000 (12:48 +0200)
committerNathan Cutler <ncutler@suse.com>
Fri, 7 Dec 2018 18:27:10 +0000 (19:27 +0100)
Signed-off-by: Nick Erdmann <n@nirf.de>
(cherry picked from commit 99ce3aaf0b5b78e2c7452ee986d8dbfab08aa2d2)

Conflicts:
doc/radosgw/adminops.rst (trivial resolution)

doc/radosgw/adminops.rst
src/rgw/rgw_rest_user.cc

index 5da13a8b944a883a128f92b61344863d3921a2c0..16efd5f848375ee016c0f5858bca0804d46eb867 100644 (file)
@@ -1858,8 +1858,9 @@ Valid parameters for quotas include:
   the maximum number of objects. A negative value disables this setting.
   
 - **Maximum Size:** The ``max-size`` option allows you to specify a quota
-  for the maximum number of bytes. A negative value disables this setting.
-  
+  for the maximum number of bytes. The ``max-size-kb`` option allows you
+  to specify it in KiB. A negative value disables this setting.
+
 - **Quota Type:** The ``quota-type`` option sets the scope for the quota.
   The options are ``bucket`` and ``user``.
 
index ee526e3c03a41fdc80e1d834dbebf3c192d47c58..cb2137a66bde7a6dd74cb7e87fd23aa0b0897ded 100644 (file)
@@ -895,11 +895,14 @@ void RGWOp_Quota_Set::execute()
         old_quota = &info.bucket_quota;
       }
 
-      int64_t old_max_size_kb = rgw_rounded_kb(old_quota->max_size);
-      int64_t max_size_kb;
       RESTArgs::get_int64(s, "max-objects", old_quota->max_objects, &quota.max_objects);
-      RESTArgs::get_int64(s, "max-size-kb", old_max_size_kb, &max_size_kb);
-      quota.max_size = max_size_kb * 1024;
+      RESTArgs::get_int64(s, "max-size", old_quota->max_size, &quota.max_size);
+      int64_t max_size_kb;
+      bool has_max_size_kb = false;
+      RESTArgs::get_int64(s, "max-size-kb", 0, &max_size_kb, &has_max_size_kb);
+      if (has_max_size_kb) {
+        quota.max_size = max_size_kb * 1024;
+      }
       RESTArgs::get_bool(s, "enabled", old_quota->enabled, &quota.enabled);
     }