From 83702b070709a2d9ccdc233f96d5e4cd442dfe9b Mon Sep 17 00:00:00 2001 From: Charles Lamb Date: Mon, 7 Jul 2014 09:51:49 +0000 Subject: [PATCH] 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 --- .../hadoop-hdfs/CHANGES-fs-encryption.txt | 2 ++ .../hdfs/server/namenode/FSDirectory.java | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-fs-encryption.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-fs-encryption.txt index e1bab08693e..75eace4d865 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-fs-encryption.txt +++ b/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-6629. Not able to create symlinks after HDFS-6516 (umamaheswararao) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java index 53994f91af9..d8bf08d6120 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java +++ b/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) { if (inode instanceof INodeWithAdditionalFields) { inodeMap.put(inode); - final XAttrFeature xaf = inode.getXAttrFeature(); - if (xaf != null) { - final List 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 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())); + } } } }