Browse Source

HDFS-6629. Not able to create symlinks after HDFS-6516 (umamaheswararao)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/fs-encryption@1608389 13f79535-47bb-0310-9956-ffa450edef68
Charles Lamb 11 years ago
parent
commit
83702b0707

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES-fs-encryption.txt

@@ -37,6 +37,8 @@ fs-encryption (Unreleased)
 
 
     HDFS-6516. List of Encryption Zones should be based on inodes (clamb)
     HDFS-6516. List of Encryption Zones should be based on inodes (clamb)
 
 
+    HDFS-6629. Not able to create symlinks after HDFS-6516 (umamaheswararao)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
   BUG FIXES
   BUG FIXES

+ 10 - 9
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

@@ -2230,15 +2230,16 @@ public class FSDirectory implements Closeable {
   public final void addToInodeMap(INode inode) {
   public final void addToInodeMap(INode inode) {
     if (inode instanceof INodeWithAdditionalFields) {
     if (inode instanceof INodeWithAdditionalFields) {
       inodeMap.put(inode);
       inodeMap.put(inode);
-      final XAttrFeature xaf = inode.getXAttrFeature();
-      if (xaf != null) {
-        final List<XAttr> xattrs = xaf.getXAttrs();
-        for (XAttr xattr : xattrs) {
-          final String xaName = XAttrHelper.getPrefixName(xattr);
-          if (CRYPTO_XATTR_ENCRYPTION_ZONE.equals(xaName)) {
-            encryptionZones.put(inode.getId(),
-              new EncryptionZoneInt(new String(xattr.getValue()),
-                                    inode.getId()));
+      if (!inode.isSymlink()) {
+        final XAttrFeature xaf = inode.getXAttrFeature();
+        if (xaf != null) {
+          final List<XAttr> xattrs = xaf.getXAttrs();
+          for (XAttr xattr : xattrs) {
+            final String xaName = XAttrHelper.getPrefixName(xattr);
+            if (CRYPTO_XATTR_ENCRYPTION_ZONE.equals(xaName)) {
+              encryptionZones.put(inode.getId(), new EncryptionZoneInt(
+                  new String(xattr.getValue()), inode.getId()));
+            }
           }
           }
         }
         }
       }
       }