captainzmc commented on a change in pull request #1677:
URL: https://github.com/apache/ozone/pull/1677#discussion_r545536353
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -314,7 +314,9 @@ private BucketEncryptionInfoProto getBeinfo(
*/
private void checkQuotaInNamespace(OmVolumeArgs omVolumeArgs,
long allocatedNamespace) throws IOException {
- if (omVolumeArgs.getQuotaInNamespace() != OzoneConsts.QUOTA_RESET) {
+ // Client has ensured that no negative values other than -1 (clear quota)
+ // will occur when quota is set.
+ if (omVolumeArgs.getQuotaInNamespace() > OzoneConsts.QUOTA_RESET) {
Review comment:
Current there are two case -1 or -2 (old volume/bucket) not check
quota, actually we have guarantee on the client, [user cann’t set negative
quota](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java#L194),
Therefore, except for clear quota and Old Quoat, there is no negative case.
Increase omVolumeArgs. getQuotaInNamespace ()! = 2. This condition is more,
we can use omVolumeArgs. getQuotaInNamespace () > 0.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]