code: private boolean recoverStorageDirs(StartupOption startOpt,
        Map<StorageDirectory, StorageState> dataDirStates) throws IOException {
      boolean isFormatted = false;
      for (Iterator<StorageDirectory> it = 
                        storage.dirIterator(); it.hasNext();) {
        StorageDirectory sd = it.next();
        StorageState curState;
        try {
          curState = sd.analyzeStorage(startOpt);
          isFormatted |= NNStorage.recoverDirectory(sd, startOpt, curState, true);
        } catch (IOException ioe) {
          sd.unlock();
          throw ioe;
        }
        dataDirStates.put(sd,curState);
      }
      return isFormatted;
    }
docs: For each storage directory, performs recovery of incomplete transitions
  (eg. upgrade, rollback, checkpoint) and inserts the directory's storage
  state into the dataDirStates map.
  @param dataDirStates output of storage directory states
  @return true if there is at least one valid formatted storage directory