From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7395CC433F5 for ; Fri, 15 Oct 2021 19:50:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E92560FE3 for ; Fri, 15 Oct 2021 19:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242862AbhJOTwr (ORCPT ); Fri, 15 Oct 2021 15:52:47 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:54894 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242806AbhJOTwq (ORCPT ); Fri, 15 Oct 2021 15:52:46 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 19FJobEk008518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Oct 2021 15:50:37 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id D7CCC15C00CA; Fri, 15 Oct 2021 15:50:36 -0400 (EDT) Date: Fri, 15 Oct 2021 15:50:36 -0400 From: "Theodore Ts'o" To: Avi Deitcher Cc: linux-ext4@vger.kernel.org Subject: Re: algorithm for half-md4 used in htree directories Message-ID: References: <3A493D20-568A-4D63-A575-5DEEBFAAF41A@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Oh, and taking a quick look at your program, here's at least one of the bugs: static void calculate(char *name) { ^^^^^^^^^^ ... __ext4fs_dirhash(name, sizeof(name), &hinfo); ^^^^^^^^^^^^ With apologies to the movie "The Princess Bride"[1]: You fell victim to one of the classic blunders! The most famous is to never get involved in a land war in Asia, but only slightly less well-known is this: 'taking the size of a C pointer is generally not what you had wanted to do'! :-) [1] https://www.youtube.com/watch?v=R7TFPQqglb4 - Ted