diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index fe71564aba..e7974ebec7 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1120,6 +1120,9 @@ Release 2.8.0 - UNRELEASED HADOOP-12699. TestKMS#testKMSProvider intermittently fails during 'test rollover draining'. (Xiao Chen via wang) + HADOOP-12776. Remove getaclstatus call for non-acl commands in getfacl. + (Brahma Reddy Battula via vinayakumarb) + OPTIMIZATIONS HADOOP-11785. Reduce the number of listStatus operation in distcp diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java index d139ebadce..42829bf3e8 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java @@ -86,9 +86,15 @@ protected void processPath(PathData item) throws IOException { (perm.getOtherAction().implies(FsAction.EXECUTE) ? "t" : "T")); } - AclStatus aclStatus = item.fs.getAclStatus(item.path); - List entries = perm.getAclBit() ? aclStatus.getEntries() - : Collections. emptyList(); + AclStatus aclStatus = null; + List entries = null; + if (perm.getAclBit()) { + aclStatus = item.fs.getAclStatus(item.path); + entries = aclStatus.getEntries(); + } else { + aclStatus = null; + entries = Collections. emptyList(); + } ScopedAclEntries scopedEntries = new ScopedAclEntries( AclUtil.getAclFromPermAndEntries(perm, entries)); printAclEntriesForSingleScope(aclStatus, perm,