[U-Boot] [Patch v2] Fix hash table deletion to prevent lost entries

Wolfgang Denk wd at denx.de
Tue Mar 22 22:45:50 CET 2011


Dear Peter Barada,

In message <4D87D9B0.1080102 at logicpd.com> you wrote:
>
> > Can you please fix these, and resubmit?
> Updated patch attached (Thunderbird munched tabs)...

Thanks.

> > Also, do you happen to have a test case that can be used show the
> > problem in the existing code, and to test the patch?
> No, I don't have a testcase off hand (IIRC hashtable size is dependent on size of u-boot and amount of RAM), from my original email:

I was able to verify both the problem and that your fix fixes it.
Tested on "qong".

Added a Tested-by: Wolfgang Denk <wd at denx.de>

> From: Peter Barada <peter.barada at logicpd.com>
> Date: Mon, 21 Mar 2011 19:01:57 -0500
> Subject: [PATCH] Fix hashtable to properly handle deletion.
> 
> Use negative used value to mark deleted entry.  Search keeps probing
> past deleted entries.  Adding an entry uses first deleted entry when
> it hits end of probe chain.
> 
> Initially found that "ramdiskimage" and "preboot" collide modulus 347,
> causing "preboot" to be inserted at idx 190, "ramdiskimage" at idx 191.
> Previous to this fix when "preboot" is deleted, "ramdiskimage" is
> orphaned.
> 
> Signed-off-by: Peter Barada <peter.barada at logicpd.com>
> ---
> diff --git a/lib/hashtable.c b/lib/hashtable.c
> index 9f069c0..fcdb53c 100644
> --- a/lib/hashtable.c
> +++ b/lib/hashtable.c

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Just because your doctor has a name for your condition  doesn't  mean
he knows what it is.


More information about the U-Boot mailing list