diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 8b234fe0cd..fcf5994b3a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -637,6 +637,8 @@ Release 2.7.0 - UNRELEASED HDFS-7604. Track and display failed DataNode storage locations in NameNode. (cnauroth) + HDFS-7797. Add audit log for setQuota operation (Rakesh R via umamahesh) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 84ab179790..06d7bd0803 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -3814,14 +3814,19 @@ void setQuota(String src, long nsQuota, long ssQuota, StorageType type) throws IOException { checkOperation(OperationCategory.WRITE); writeLock(); + boolean success = false; try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot set quota on " + src); FSDirAttrOp.setQuota(dir, src, nsQuota, ssQuota, type); + success = true; } finally { writeUnlock(); + if (success) { + getEditLog().logSync(); + } + logAuditEvent(success, "setQuota", src); } - getEditLog().logSync(); } /** Persist all metadata about this file.