You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Thomas Graves (JIRA)" <ji...@apache.org> on 2012/09/05 18:00:07 UTC
[jira] [Commented] (HDFS-3890) filecontext mkdirs doesn't apply
umask as expected
[ https://issues.apache.org/jira/browse/HDFS-3890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448839#comment-13448839 ]
Thomas Graves commented on HDFS-3890:
-------------------------------------
It appears what is happening is fileContext.mkdirs calls into hdfs.mkdirs, which calls the DFSClient.mkdirs. DFSClient is applying the umask from the conf. I think hdfs.mkdirs needs to call primitiveMkdir, although primitiveMkdir is missing the create Parent flag, so I believe a new primitiveMkdir function should be created which has the extra createParent boolean flag.
I'm attaching a patch with these changes that I tested in my usecase. It still needs unit tests but folks can look at it and see if its the right things to do.
> filecontext mkdirs doesn't apply umask as expected
> --------------------------------------------------
>
> Key: HDFS-3890
> URL: https://issues.apache.org/jira/browse/HDFS-3890
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.23.3
> Reporter: Thomas Graves
> Assignee: Thomas Graves
> Priority: Critical
>
> I was attempting to set the umask of my fileContext and then do a mkdirs, but the umask wasn't applied as expected.
> doneDirFc = FileContext.getFileContext(doneDirPrefixPath.toUri(), conf);
> doneDirFc.setUMask(JobHistoryUtils.HISTORY_DONE_DIR_UMASK);
> doneDirFc.mkdir(path, fsp, true);
> It appears to be using the default umask set in the conf (fs.permissions.umask-mode) and overrode the umask I set in fileContext. I had the default umask set to 077 and set the filecontext umask to 007. The permissions on the directories it created were all rwx------.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira