From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lt6nj-0004vF-Nj for mharc-grub-devel@gnu.org; Sun, 12 Apr 2009 17:01:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lt6ni-0004ti-HA for grub-devel@gnu.org; Sun, 12 Apr 2009 17:01:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lt6ne-0004tC-1Q for grub-devel@gnu.org; Sun, 12 Apr 2009 17:01:14 -0400 Received: from [199.232.76.173] (port=48962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lt6nd-0004t9-Rx for grub-devel@gnu.org; Sun, 12 Apr 2009 17:01:09 -0400 Received: from c60.cesmail.net ([216.154.195.49]:59529) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1Lt6nd-0006vb-Di for grub-devel@gnu.org; Sun, 12 Apr 2009 17:01:09 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 12 Apr 2009 17:01:09 -0400 Received: from [192.168.0.220] (pool-141-151-93-148.phlapa.east.verizon.net [141.151.93.148]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 8456534C6A for ; Sun, 12 Apr 2009 17:02:37 -0400 (EDT) From: Pavel Roskin To: grub-devel In-Reply-To: <20090412.010121.183222401.davem@davemloft.net> References: <20090411.010833.154152360.davem@davemloft.net> <1239517755.3887.24.camel@mj> <20090412.010121.183222401.davem@davemloft.net> Content-Type: text/plain Date: Sun, 12 Apr 2009 17:01:07 -0400 Message-Id: <1239570067.14481.14.camel@ct> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 (2.24.5-1.fc10) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH]: grub: Fix ofdisk disk cache corruption. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 21:01:14 -0000 On Sun, 2009-04-12 at 01:01 -0700, David Miller wrote: > > That's a 3 bit hash. The risk of collisions is very high. I would > > understand if you had 8 entries for the hash values, but the hash values > > themselves should be reasonably unique. > > In my testing there weren't many collisions. > > I think fixing disk cache corruption is more important than > arguing over the distribution properties of the hash function > I have choosen. > > Right? It's not just about distribution properties. My impression is that your code misuses hashes as indices in a table. Let's make the hash 32-bit. That would make it harder to misuse. -- Regards, Pavel Roskin