]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix bug of apply default quota, for this create new a user may core using beast 27335/head
authorliaoxin01 <liaoxin01@baidu.com>
Wed, 3 Apr 2019 03:36:02 +0000 (11:36 +0800)
committerliaoxin01 <liaoxin01@baidu.com>
Wed, 3 Apr 2019 03:36:02 +0000 (11:36 +0800)
Signed-off-by: liaoxin01 <liaoxin01@baidu.com>
src/rgw/rgw_auth.cc
src/rgw/rgw_user.cc

index 2708106d08b2d6da927ca7ea261790a1b72f91ee..9e2b85f27b2813cfb2c363bd39f1f6b5d6e090bd 100644 (file)
@@ -406,8 +406,8 @@ void rgw::auth::RemoteApplier::create_account(const rgw_user& acct_user,
   user_info.display_name = info.acct_name;
 
   user_info.max_buckets = cct->_conf->rgw_user_max_buckets;
-  rgw_apply_default_bucket_quota(user_info.bucket_quota, cct->_conf);
-  rgw_apply_default_user_quota(user_info.user_quota, cct->_conf);
+  rgw_apply_default_bucket_quota(user_info.bucket_quota, *cct->_conf);
+  rgw_apply_default_user_quota(user_info.user_quota, *cct->_conf);
 
   int ret = rgw_store_user_info(store, user_info, nullptr, nullptr,
                                 real_time(), true);
index b3a7c825178b5ce05083a1a70ed9b207bffa7fa4..7be5ca4e445dda980094fc228df9d06682d63811 100644 (file)
@@ -1965,7 +1965,7 @@ int RGWUser::execute_add(RGWUserAdminOpState& op_state, std::string *err_msg)
   if (op_state.has_bucket_quota()) {
     user_info.bucket_quota = op_state.get_bucket_quota();
   } else {
-    rgw_apply_default_bucket_quota(user_info.bucket_quota, cct->_conf);
+    rgw_apply_default_bucket_quota(user_info.bucket_quota, *cct->_conf);
   }
 
   if (op_state.temp_url_key_specified) {
@@ -1979,7 +1979,7 @@ int RGWUser::execute_add(RGWUserAdminOpState& op_state, std::string *err_msg)
   if (op_state.has_user_quota()) {
     user_info.user_quota = op_state.get_user_quota();
   } else {
-    rgw_apply_default_user_quota(user_info.user_quota, cct->_conf);
+    rgw_apply_default_user_quota(user_info.user_quota, *cct->_conf);
   }
 
   // update the request