From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 22 Mar 2011 22:45:50 +0100 Subject: [U-Boot] [Patch v2] Fix hash table deletion to prevent lost entries In-Reply-To: <4D87D9B0.1080102@logicpd.com> References: <4D34C85E.4030408@logicpd.com> <20110119083223.DEA112FC@gemini.denx.de> <4D371208.3090801@logicpd.com> <20110119204755.B8D0DD301BF@gemini.denx.de> <4D385A7F.2070803@logicpd.com> <20110321214823.EA538151A99@gemini.denx.de> <4D87D9B0.1080102@logicpd.com> Message-ID: <20110322214550.D19AB151F7D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peter Barada, In message <4D87D9B0.1080102@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 > From: Peter Barada > 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 > --- > 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.