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

Wolfgang Denk wd at denx.de
Mon Mar 21 22:48:23 CET 2011


Dear Peter Barada,

In message <4D385A7F.2070803 at logicpd.com> you wrote:
> On 01/19/2011 03:47 PM, Wolfgang Denk wrote:
> > Dear Peter Barada,
> >
> > In message <4D371208.3090801 at logicpd.com> you wrote:
> >>>> The hash delete code is in error; instead of just removing the deleted
> >>>> key, it should instead allocate a new hashtable, hash all the keys into
> >>>> the new table except for the deleted key and then reclaim the old table
> >>>> (and deleted key).
> >>> Can you please come up with a patch?
> >>
> 
> From: Peter Barada <peter.barada at logicpd.com>
> Date: Thu, 20 Jan 2011 10:38: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.
> 
> Signed-off-by: Peter Barada <peter.barada at logicpd.com>

Checkpatch generates a number of errors:

	[PATCH] Fix hashtable to properly handle deletion.
	total: 8 errors, 16 warnings, 66 lines checked

Can you please fix these, and resubmit?

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?

Thanks.

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
Any sufficiently advanced bug is indistinguishable from a feature.
                                                      - Rich Kulawiec


More information about the U-Boot mailing list