code: void invalidateCorruptReplicas(Block blk) {
      Collection<DatanodeDescriptor> nodes = corruptReplicas.getNodes(blk);
      boolean gotException = false;
      if (nodes == null) {
        return;
      }
      // Make a copy of this list, since calling invalidateBlock will modify
      // the original (avoid CME)
      nodes = new ArrayList<DatanodeDescriptor>(nodes);
      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("NameNode.invalidateCorruptReplicas: " +
            "invalidating corrupt replicas on " + nodes.size() + "nodes");
      }
      for (Iterator<DatanodeDescriptor> it = nodes.iterator(); it.hasNext();) {
        DatanodeDescriptor node = it.next();
        try {
          invalidateBlock(blk, node, true);
        } catch (IOException e) {
          NameNode.stateChangeLog.info("NameNode.invalidateCorruptReplicas " +
            "error in deleting bad block " + blk +
            " on " + node + e);
          gotException = true;
        }
      }
      // Remove the block from corruptReplicasMap
      if (!gotException) {
        corruptReplicas.removeFromCorruptReplicasMap(blk);
      }
    }
docs: Invalidate corrupt replicas.
  <p/>
  This will remove the replicas from the block's location list,
  add them to {@link #recentInvalidateSets} so that they could be further
  deleted from the respective data-nodes,
  and remove the block from corruptReplicasMap.
  <p/>
  This method should be called when the block has sufficient
  number of live replicas.
  
  @param blk Block whose corrupt replicas need to be invalidated