Don't just loop indefinitely when an obfuscated name comes up as a
duplicate. Count the number of times we've found a duplicate and if
if it gets excessive despite choosing names at random, just give up
and use the original name without obfuscation.
Technically, a typical 5-character name has 255 other names that can
have the same hash value. But the algorithm doesn't hit all
possible names (far from it) so duplicates are still possible.
Updates (v4):
- Rearranged things a bit so that if too many duplicates are
encountered, a warning gets emitted.
Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>