[ https://issues.apache.org/jira/browse/HADOOP-6962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036252#comment-13036252 ]
Daryn Sharp commented on HADOOP-6962: ------------------------------------- Apologies, my comments were more about the patch on the linked HDFS-1869. The FileSystem api for creating directories is somewhat confusing. Here's my reading of the code: For localfs: 1. *public boolean mkdirs(Path f)* uses the umask for dirs0..N. 2. *public boolean mkdirs(Path f, FsPermission permission)* uses umask for dir0..N-1, given perms for dirN. For hdfs: 1. *public boolean mkdirs(Path f)* uses the parent dir's permission for dir0..N-1, 0777 for dirN. 2. *public boolean mkdirs(Path f, FsPermission permission)* uses the parent dir's permission for dir0..N-1, given permission for dirN In both cases, *public +static+ boolean mkdirs(FileSystem fs, Path dir, FsPermission permission)* calls #1 + setPermission which has the same effect as #2, hence this change. The linked HDFS bug creates dir0..N with the given permissions which restores how it used to work, and restores posix compliance. However, it now differs from localfs, but localfs is in contradiction to FileSystem: {code} /** * Make the given file and all non-existent parents into * directories. Has the semantics of Unix 'mkdir -p'. * Existence of the directory hierarchy is not an error. */ public abstract boolean mkdirs(Path f, FsPermission permission ) throws IOException; {code} > FileSystem.mkdirs(Path, FSPermission) should use the permission for all of > the created directories > -------------------------------------------------------------------------------------------------- > > Key: HADOOP-6962 > URL: https://issues.apache.org/jira/browse/HADOOP-6962 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Reporter: Owen O'Malley > Assignee: Daryn Sharp > Attachments: HADOOP-6962.patch > > > Currently, FileSystem.mkdirs only applies the permissions to the last level > if it was created. It should be applied to *all* levels that are created. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira