Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 60115 invoked from network); 30 Apr 2008 00:20:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Apr 2008 00:20:13 -0000 Received: (qmail 2676 invoked by uid 500); 30 Apr 2008 00:20:15 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 2647 invoked by uid 500); 30 Apr 2008 00:20:15 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 2636 invoked by uid 99); 30 Apr 2008 00:20:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2008 17:20:15 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Wed, 30 Apr 2008 00:19:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3BCDA2388999; Tue, 29 Apr 2008 17:19:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r652198 - in /hadoop/core/branches/branch-0.16: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java src/test/org/apache/hadoop/security/TestPermission.java Date: Wed, 30 Apr 2008 00:19:51 -0000 To: core-commits@hadoop.apache.org From: mukund@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080430001951.3BCDA2388999@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mukund Date: Tue Apr 29 17:19:50 2008 New Revision: 652198 URL: http://svn.apache.org/viewvc?rev=652198&view=rev Log: HADOOP-3138. DFS mkdirs() should not throw an exception if the directory already exists. (rangadi via mukund) Modified: hadoop/core/branches/branch-0.16/CHANGES.txt hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/FSNamesystem.java hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/security/TestPermission.java Modified: hadoop/core/branches/branch-0.16/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/CHANGES.txt?rev=652198&r1=652197&r2=652198&view=diff ============================================================================== --- hadoop/core/branches/branch-0.16/CHANGES.txt (original) +++ hadoop/core/branches/branch-0.16/CHANGES.txt Tue Apr 29 17:19:50 2008 @@ -1,5 +1,12 @@ Hadoop Change Log +Release 0.16.4 - 2008-05-05 + + BUG FIXES + + HADOOP-3138. DFS mkdirs() should not throw an exception if the directory + already exists. (rangadi via mukund) + Release 0.16.3 - 2008-04-16 BUG FIXES Modified: hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/FSNamesystem.java URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/FSNamesystem.java?rev=652198&r1=652197&r2=652198&view=diff ============================================================================== --- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original) +++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/dfs/FSNamesystem.java Tue Apr 29 17:19:50 2008 @@ -1567,6 +1567,14 @@ private synchronized boolean mkdirsInternal(String src, PermissionStatus permissions) throws IOException { NameNode.stateChangeLog.debug("DIR* NameSystem.mkdirs: " + src); + if (isPermissionEnabled) { + checkTraverse(src); + } + if (dir.isDir(src)) { + // all the users of mkdirs() are used to expect 'true' even if + // a new directory is not created. + return true; + } if (isInSafeMode()) throw new SafeModeException("Cannot create directory " + src, safeMode); if (!isValidName(src)) { Modified: hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/security/TestPermission.java URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/security/TestPermission.java?rev=652198&r1=652197&r2=652198&view=diff ============================================================================== --- hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/security/TestPermission.java (original) +++ hadoop/core/branches/branch-0.16/src/test/org/apache/hadoop/security/TestPermission.java Tue Apr 29 17:19:50 2008 @@ -161,6 +161,10 @@ userGroupInfo.toString()); fs = FileSystem.get(conf); + // make sure mkdir of a existing directory that is not owned by + // this user does not throw an exception. + fs.mkdirs(CHILD_DIR1); + // illegal mkdir assertTrue(!canMkdirs(fs, CHILD_DIR2));