Description
checkUnreadableBySuperuser is to check whether super user can access specific path. The code logic is not efficient. It does iteration check for all user, actually we just need to check super user and can save few cpu cycle.
private void checkUnreadableBySuperuser(FSPermissionChecker pc, INode inode, int snapshotId) throws IOException { for (XAttr xattr : dir.getXAttrs(inode, snapshotId)) { if (XAttrHelper.getPrefixName(xattr). equals(SECURITY_XATTR_UNREADABLE_BY_SUPERUSER)) { if (pc.isSuperUser()) { throw new AccessControlException("Access is denied for " + pc.getUser() + " since the superuser is not allowed to " + "perform this operation."); } } } }