Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B7E210B37 for ; Mon, 17 Jun 2013 20:54:56 +0000 (UTC) Received: (qmail 86694 invoked by uid 500); 17 Jun 2013 20:54:55 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 86661 invoked by uid 500); 17 Jun 2013 20:54:55 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 86652 invoked by uid 99); 17 Jun 2013 20:54:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jun 2013 20:54:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jun 2013 20:54:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E88192388847; Mon, 17 Jun 2013 20:54:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1493932 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java Date: Mon, 17 Jun 2013 20:54:34 -0000 To: hdfs-commits@hadoop.apache.org From: cnauroth@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130617205434.E88192388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cnauroth Date: Mon Jun 17 20:54:34 2013 New Revision: 1493932 URL: http://svn.apache.org/r1493932 Log: HDFS-4910. TestPermission failed in branch-2. Contributed by Chuan Liu. Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1493932&r1=1493931&r2=1493932&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Mon Jun 17 20:54:34 2013 @@ -386,6 +386,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/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/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java?rev=1493932&r1=1493931&r2=1493932&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java Mon Jun 17 20:54:34 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()} */