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