hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muk...@apache.org
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 GMT
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));
 



Mime
View raw message