When the block scanner comes across a file that is corrupted, the DataNode reports this particular file to the NameNode.
The NameNode then processes the file by creating replicas of the same using the original (corrupted) file.
If there is a match between the replicas created and the replication block, then the corrupted data block is not removed.