hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinayakum...@apache.org
Subject git commit: HDFS-7252. small refinement to the use of isInAnEZ in FSNamesystem. (Yi Liu via vinayakumarb)
Date Fri, 17 Oct 2014 12:35:58 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 7c87c2b42 -> 6f19ba768


HDFS-7252. small refinement to the use of isInAnEZ in FSNamesystem. (Yi Liu via vinayakumarb)

(cherry picked from commit 368743140dd076ecd5af309c1ed83c5ae2d59fc8)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6f19ba76
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6f19ba76
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6f19ba76

Branch: refs/heads/branch-2
Commit: 6f19ba76888d945873c8e04ef6d515392ce74e59
Parents: 7c87c2b
Author: Vinayakumar B <vinayakumarb@apache.org>
Authored: Fri Oct 17 18:03:44 2014 +0530
Committer: Vinayakumar B <vinayakumarb@apache.org>
Committed: Fri Oct 17 18:05:16 2014 +0530

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt             |  3 +++
 .../hadoop/hdfs/server/namenode/FSNamesystem.java       | 12 +++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f19ba76/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 01651dc..30b0e66 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -44,6 +44,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7242. Code improvement for FSN#checkUnreadableBySuperuser.
     (Yi Liu via vinayakumarb)
 
+    HDFS-7252. small refinement to the use of isInAnEZ in FSNamesystem.
+    (Yi Liu via vinayakumarb)
+
 Release 2.6.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f19ba76/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
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 7be6cc1..db2cc23 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
@@ -2561,11 +2561,11 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
         src = resolvePath(src, pathComponents);
         INodesInPath iip = dir.getINodesInPath4Write(src);
         // Nothing to do if the path is not within an EZ
-        if (dir.isInAnEZ(iip)) {
-          EncryptionZone zone = dir.getEZForPath(iip);
+        final EncryptionZone zone = dir.getEZForPath(iip);
+        if (zone != null) {
           protocolVersion = chooseProtocolVersion(zone, supportedVersions);
           suite = zone.getSuite();
-          ezKeyName = dir.getKeyName(iip);
+          ezKeyName = zone.getKeyName();
 
           Preconditions.checkNotNull(protocolVersion);
           Preconditions.checkNotNull(suite);
@@ -2648,14 +2648,16 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
     }
 
     FileEncryptionInfo feInfo = null;
-    if (dir.isInAnEZ(iip)) {
+
+    final EncryptionZone zone = dir.getEZForPath(iip);
+    if (zone != null) {
       // The path is now within an EZ, but we're missing encryption parameters
       if (suite == null || edek == null) {
         throw new RetryStartFileException();
       }
       // Path is within an EZ and we have provided encryption parameters.
       // Make sure that the generated EDEK matches the settings of the EZ.
-      String ezKeyName = dir.getKeyName(iip);
+      final String ezKeyName = zone.getKeyName();
       if (!ezKeyName.equals(edek.getEncryptionKeyName())) {
         throw new RetryStartFileException();
       }


Mime
View raw message