Actions
Bug #9907
closedradosgw-admin: can't disable max_size quota
Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Community (dev)
Tags:
Backport:
giant, firefly
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
From pull request, by Dong Lei:
we want to enable quota, but we do not want limit max_object_size, so we use: sudo radosgw-admin quota set --quota-scope=user --uid={user_id} --max-objects={whatever} --max-size=-1 to disable max size quota. the param max_size = -1 is converted to max_size_kb by: quota.max_size_kb = rgw_rounded_kb(max_size); the problem is the type of max_size and max_size_kb is int64_t, but rgw_rouned_kb takes an uint64_t and returns an uint64_t: static inline uint64_t rgw_rounded_kb(uint64_t bytes) { return (bytes + 1023) / 1024; } so rgw_rounded_kb never returns negative value for max_size_kb. when checking quota the condition is: if (quota.max_size_kb >= 0 && ... ) this condition is always true, and it's the problem. the fix can be 1. prejudge the value of max_size, if max_size < 0, do not do round, put -1 to max_size_kb (this is what I do) 2. loose the condition for checking quota: change quota.max_size_kb >= 0 to quota.max_size_kb > 0 this is simpler, but it depends on whether max_size_kb == 0 should be meaningful.
Actions