private void preCheckPermission() throws IOException {
    if (shouldIgnorePreCheckPermission()) {
      return;
    }

    Path hbaseDir = CommonFSUtils.getRootDir(getConf());
    FileSystem fs = hbaseDir.getFileSystem(getConf());
    UserProvider userProvider = UserProvider.instantiate(getConf());
    UserGroupInformation ugi = userProvider.getCurrent().getUGI();
    FileStatus[] files = fs.listStatus(hbaseDir);
    for (FileStatus file : files) {
      try {
        fs.access(file.getPath(), FsAction.WRITE);
      } catch (AccessControlException ace) {
        LOG.warn("Got AccessDeniedException when preCheckPermission ", ace);
        errors.reportError(ERROR_CODE.WRONG_USAGE,
          "Current user " + ugi.getUserName() + " does not have write perms to " + file.getPath()
            + ". Please rerun hbck as hdfs user " + file.getOwner());
        throw ace;
      }
    }
  }
Check and fix table states, assumes full info available: - tableInfos - empty tables loaded
hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java