code: private boolean safeFsMkdir(FileSystem fs, Path f, FsPermission permission) throws IOException {
      try {
        return fs.mkdirs(f, permission);
      } catch (IOException e) {
        // To handle the case when trash folder is created by other threads
        // The case is rare and we don't put synchronized keywords for performance consideration.
        if (!fs.exists(f)) {
          throw new IOException("Failed to create trash folder while it is still not existed yet.");
        } else {
          LOG.debug("Target folder %s has been created by other threads.", f.toString());
          return true;
        }
      }
    }
docs: Safe creation of trash folder to ensure thread-safe.
  @throws IOException