xfs
[Top] [All Lists]

Re: [PATCH v3, 09/16] xfsprogs: metadump: don't loop on too many dups

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH v3, 09/16] xfsprogs: metadump: don't loop on too many dups
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 24 Feb 2011 12:55:10 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201102182121.p1ILL1fw029119@xxxxxxxxxxxxxxxxxxxxxx>
References: <201102182121.p1ILL1fw029119@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 18, 2011 at 03:21:01PM -0600, Alex Elder wrote:
> 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.
> 
> Signed-off-by: Alex Elder <aelder@xxxxxxx>
> 
> The only change worth mentioning from the last version posted is
> that the duplicate count is now updated inside the loop that
> searches the name table.

The only thing that I'd suggest here is that we emit a warning to
indicate that we haven't obfuscated a name due to excessive
duplicates being created. If the user has asked for obfuscation, we
shoul dat least inform them  failures to do so for filenames that
should be obfuscated....

Otherwise,

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>