@@ -331,16 +331,15 @@ private void checkSubDir(final Path p, final String dirPermsConfName) throws IOE
331331 throw new IOException ("HBase directory '" + p + "' creation failure." );
332332 }
333333 }
334- } else {
335- if (isSecurityEnabled && !dirPerms .equals (fs .getFileStatus (p ).getPermission ())) {
336- // check whether the permission match
337- LOG .warn ("Found HBase directory permissions NOT matching expected permissions for "
338- + p .toString () + " permissions=" + fs .getFileStatus (p ).getPermission () + ", expecting "
339- + dirPerms + ". Automatically setting the permissions. "
340- + "You can change the permissions by setting \" " + dirPermsConfName
341- + "\" in hbase-site.xml " + "and restarting the master" );
342- fs .setPermission (p , dirPerms );
343- }
334+ }
335+ if (isSecurityEnabled && !dirPerms .equals (fs .getFileStatus (p ).getPermission ())) {
336+ // check whether the permission match
337+ LOG .warn ("Found HBase directory permissions NOT matching expected permissions for "
338+ + p .toString () + " permissions=" + fs .getFileStatus (p ).getPermission () + ", expecting "
339+ + dirPerms + ". Automatically setting the permissions. "
340+ + "You can change the permissions by setting \" " + dirPermsConfName
341+ + "\" in hbase-site.xml " + "and restarting the master" );
342+ fs .setPermission (p , dirPerms );
344343 }
345344 }
346345
@@ -355,9 +354,9 @@ private void checkStagingDir() throws IOException {
355354 if (!this .fs .mkdirs (p , HiddenDirPerms )) {
356355 throw new IOException ("Failed to create staging directory " + p .toString ());
357356 }
358- } else {
359- this .fs .setPermission (p , HiddenDirPerms );
360357 }
358+ this .fs .setPermission (p , HiddenDirPerms );
359+
361360 } catch (IOException e ) {
362361 LOG .error ("Failed to create or set permission on staging directory " + p .toString ());
363362 throw new IOException (
0 commit comments