You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by cn...@apache.org on 2013/06/18 01:40:21 UTC
svn commit: r1493974 - in
/hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs:
CHANGES.txt
src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
Author: cnauroth
Date: Mon Jun 17 23:40:21 2013
New Revision: 1493974
URL: http://svn.apache.org/r1493974
Log:
HDFS-4910. Merging change r1493932 from branch-2 to branch-2.1-beta.
Modified:
hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
Modified: hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1493974&r1=1493973&r2=1493974&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Mon Jun 17 23:40:21 2013
@@ -359,6 +359,8 @@ Release 2.1.0-beta - UNRELEASED
HDFS-4845. FSNamesystem.deleteInternal should acquire write-lock before
changing the inode map. (Arpit Agarwal via szetszwo)
+ HDFS-4910. TestPermission failed in branch-2. (Chuan Liu via cnauroth)
+
BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS
HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes.
Modified: hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java?rev=1493974&r1=1493973&r2=1493974&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java (original)
+++ hadoop/common/branches/branch-2.1-beta/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java Mon Jun 17 23:40:21 2013
@@ -144,35 +144,35 @@ class FSPermissionChecker {
+ ", resolveLink=" + resolveLink);
}
// check if (parentAccess != null) && file exists, then check sb
- // Resolve symlinks, the check is performed on the link target.
- final INodesInPath inodesInPath = root.getINodesInPath(path, true);
- final Snapshot snapshot = inodesInPath.getPathSnapshot();
- final INode[] inodes = inodesInPath.getINodes();
- int ancestorIndex = inodes.length - 2;
- for(; ancestorIndex >= 0 && inodes[ancestorIndex] == null;
- ancestorIndex--);
- checkTraverse(inodes, ancestorIndex, snapshot);
-
- final INode last = inodes[inodes.length - 1];
- if (parentAccess != null && parentAccess.implies(FsAction.WRITE)
- && inodes.length > 1 && last != null) {
- checkStickyBit(inodes[inodes.length - 2], last, snapshot);
- }
- if (ancestorAccess != null && inodes.length > 1) {
- check(inodes, ancestorIndex, snapshot, ancestorAccess);
- }
- if (parentAccess != null && inodes.length > 1) {
- check(inodes, inodes.length - 2, snapshot, parentAccess);
- }
- if (access != null) {
- check(last, snapshot, access);
- }
- if (subAccess != null) {
- checkSubAccess(last, snapshot, subAccess);
- }
- if (doCheckOwner) {
- checkOwner(last, snapshot);
- }
+ // If resolveLink, the check is performed on the link target.
+ final INodesInPath inodesInPath = root.getINodesInPath(path, resolveLink);
+ final Snapshot snapshot = inodesInPath.getPathSnapshot();
+ final INode[] inodes = inodesInPath.getINodes();
+ int ancestorIndex = inodes.length - 2;
+ for(; ancestorIndex >= 0 && inodes[ancestorIndex] == null;
+ ancestorIndex--);
+ checkTraverse(inodes, ancestorIndex, snapshot);
+
+ final INode last = inodes[inodes.length - 1];
+ if (parentAccess != null && parentAccess.implies(FsAction.WRITE)
+ && inodes.length > 1 && last != null) {
+ checkStickyBit(inodes[inodes.length - 2], last, snapshot);
+ }
+ if (ancestorAccess != null && inodes.length > 1) {
+ check(inodes, ancestorIndex, snapshot, ancestorAccess);
+ }
+ if (parentAccess != null && inodes.length > 1) {
+ check(inodes, inodes.length - 2, snapshot, parentAccess);
+ }
+ if (access != null) {
+ check(last, snapshot, access);
+ }
+ if (subAccess != null) {
+ checkSubAccess(last, snapshot, subAccess);
+ }
+ if (doCheckOwner) {
+ checkOwner(last, snapshot);
+ }
}
/** Guarded by {@link FSNamesystem#readLock()} */