diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java index 5ff3c2b70ab..8c3cdb82d74 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java @@ -1665,11 +1665,6 @@ public class ViewFileSystem extends FileSystem { throw readOnlyMountTable("mkdirs", dir); } - @Override - public boolean mkdirs(Path dir) throws IOException { - return mkdirs(dir, null); - } - @Override public FSDataInputStream open(Path f, int bufferSize) throws AccessControlException, FileNotFoundException, IOException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java index fcb52577d99..fdc746464f4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java @@ -479,4 +479,23 @@ public class TestViewFileSystemHdfs extends ViewFileSystemBaseTest { assertEquals("The owner did not match ", owner, userUgi.getShortUserName()); otherfs.delete(user1Path, false); } + + @Test + public void testInternalDirectoryPermissions() throws IOException { + LOG.info("Starting testInternalDirectoryPermissions!"); + Configuration localConf = new Configuration(conf); + ConfigUtil.addLinkFallback( + localConf, new Path(targetTestRoot, "fallbackDir").toUri()); + FileSystem fs = FileSystem.get(FsConstants.VIEWFS_URI, localConf); + // check that the default permissions on a sub-folder of an internal + // directory are the same as those created on non-internal directories. + Path subDirOfInternalDir = new Path("/internalDir/dir1"); + fs.mkdirs(subDirOfInternalDir); + + Path subDirOfRealDir = new Path("/internalDir/linkToDir2/dir1"); + fs.mkdirs(subDirOfRealDir); + + assertEquals(fs.getFileStatus(subDirOfInternalDir).getPermission(), + fs.getFileStatus(subDirOfRealDir).getPermission()); + } }