xfs
[Top] [All Lists]

Re: [PATCH v3, 02/16] xfsprogs: metadump: simplify '/' handling in gener

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH v3, 02/16] xfsprogs: metadump: simplify '/' handling in generate_obfuscated_name()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 24 Feb 2011 12:28:43 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201102182121.p1ILL1Df029040@xxxxxxxxxxxxxxxxxxxxxx>
References: <201102182121.p1ILL1Df029040@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 18, 2011 at 03:21:01PM -0600, Alex Elder wrote:
> In generate_obfuscated_name(), the incoming name is allowed to start
> with a '/' character, in which case it is copied over to the new
> name and ignored for the remainder of the hash calculation.  A '/'
> character is needlessly included at the beginning of each name
> stashed in the duplicates table (regardless of whether one was
> present in the name provided).
> 
> Simplify the affected code by processing the '/' right away, and
> using a pointer thereafter for the start of the new name.  Stop
> including a leading '/' in the name used for duplicate detection.
> 
> Note:  It is not clear a leading '/' character is ever even present
> in a name presented for obfuscation.  I have not investigated this
> question; this change merely adjusts the code while preserving its
> original functionality.
> 
> Signed-off-by: Alex Elder <aelder@xxxxxxx>
> 
> No significant changes in this version from the last one posted.

Looks sane.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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