zhaoyim commented on a change in pull request #2037:
URL: https://github.com/apache/hadoop/pull/2037#discussion_r449972840
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
##########
@@ -2553,16 +2553,17 @@ void setQuota(String src, long namespaceQuota, long
storagespaceQuota)
throws IOException {
checkOpen();
// sanity check
- if ((namespaceQuota <= 0 &&
- namespaceQuota != HdfsConstants.QUOTA_DONT_SET &&
- namespaceQuota != HdfsConstants.QUOTA_RESET) ||
- (storagespaceQuota < 0 &&
+ if (namespaceQuota <= 0 &&
+ namespaceQuota != HdfsConstants.QUOTA_DONT_SET &&
+ namespaceQuota != HdfsConstants.QUOTA_RESET){
+ throw new IllegalArgumentException("Invalid values for " +
+ "namespace quota : " + namespaceQuota);
+ }
+ if (storagespaceQuota < 0 &&
Review comment:
@Hexiaoqiao Thanks for review! ```(-9223372036854775808L - 1) ==
Long.MAX_VALUE``` and ```QUOTA_RESET = -1L``` so I think it's better to check
more condition.
----------------------------------------------------------------
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]