You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sz...@apache.org on 2014/09/19 01:15:09 UTC
[32/50] git commit: HDFS-7028: FSDirectory should not get storage
policy id from symlinks
HDFS-7028: FSDirectory should not get storage policy id from symlinks
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4124905a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4124905a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4124905a
Branch: refs/heads/trunk
Commit: 4124905aa55a8ff3d6905fd05ccf13ef4eb37afe
Parents: 6997c1c
Author: Tsz-Wo Nicholas Sze <sz...@hortonworks.com>
Authored: Wed Sep 10 12:34:15 2014 +0800
Committer: Tsz-Wo Nicholas Sze <sz...@hortonworks.com>
Committed: Wed Sep 10 12:34:15 2014 +0800
----------------------------------------------------------------------
.../org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/4124905a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
----------------------------------------------------------------------
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 b890375..f541da5 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
@@ -1423,8 +1423,8 @@ public class FSDirectory implements Closeable {
HdfsFileStatus listing[] = new HdfsFileStatus[numOfListing];
for (int i=0; i<numOfListing && locationBudget>0; i++) {
INode cur = contents.get(startChild+i);
- byte curPolicy = isSuperUser ? cur.getLocalStoragePolicyID() :
- BlockStoragePolicy.ID_UNSPECIFIED;
+ byte curPolicy = isSuperUser && !cur.isSymlink()?
+ cur.getLocalStoragePolicyID(): BlockStoragePolicy.ID_UNSPECIFIED;
listing[i] = createFileStatus(cur.getLocalNameBytes(), cur, needLocation,
getStoragePolicyID(curPolicy, parentStoragePolicy), snapshot,
isRawPath);
@@ -1503,7 +1503,7 @@ public class FSDirectory implements Closeable {
}
final INodesInPath inodesInPath = getLastINodeInPath(srcs, resolveLink);
final INode i = inodesInPath.getINode(0);
- byte policyId = includeStoragePolicy && i != null ?
+ byte policyId = includeStoragePolicy && i != null && !i.isSymlink() ?
i.getStoragePolicyID() : BlockStoragePolicy.ID_UNSPECIFIED;
return i == null ? null : createFileStatus(HdfsFileStatus.EMPTY_NAME, i,
policyId, inodesInPath.getPathSnapshotId(), isRawPath);