There's a wierd incompatibility within the various overloads of FileSystem.mkdirs .
static boolean FileSystem.mkdirs(FileSystem fs, Path path, FsPermission permission) assigns the specified permission to all directories constructed on the way to path , including the last one, path itself .
fs.mkdirs(path, permission) behaves very differently. The intermediate directories, if any, that get created, are born with the permissions of permission , but the leaf directory, path , seems to get its permissions set to a MASKED permission mask, at least when FileSystem is a DFS.
At the very least, this behavior should be documented. A better remedy, in my opinion, would be for FileSystem.mkdirs(Path, FsPermission) to change behavior so all directories created have permission bits named by the FsPermission parameter in all of the calls that have one.