zhaoyim commented on a change in pull request #2037:
URL: https://github.com/apache/hadoop/pull/2037#discussion_r450006152



##########
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:
       Yes, I see. If so, seems the -1L will throw the exception, but it should 
be OK for the internal use, such as clear quota.




----------------------------------------------------------------
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]

Reply via email to