Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2366300pxb; Sun, 17 Oct 2021 12:46:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGt1rHKtahIDizOlO4WVELQ4YTVeJxwHpqcpBq1lCGWc6BvqBAUAFyYCbC2rbjTE+sz3sl X-Received: by 2002:a17:906:1bf2:: with SMTP id t18mr23460144ejg.340.1634499971367; Sun, 17 Oct 2021 12:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634499971; cv=none; d=google.com; s=arc-20160816; b=dVGMTp+J1PJN3WwS21OFuu9wJhlEoKOVGb5e86MGD44uBNTuL/htakBw2fY6Utm3GB 8OcWSiC9nvMwfZbN7IwyTt+KZ6NVOrpXXeIiFyDYOhEuRJ+ddrkPu3YdY4nwUF1tMAHQ TJUG7mv02cluE02xt7Lloj63dmt7NNEKbzcPkTa/jYIQwTQ+8rXdk1WYlSVzN7P6Ys0D HbLIU//vbFRTW/HSlDDDkYEoNElTYJ617LZl4OTQ2ItPi9YjxUmDCJMcnYxtogtZRmiB Ogl8QMPwKFQtgkNq4bW9VnSwE0TLOwjsl1gWu9vc7PVt2Vb5/G69303Y4wJ25frGP3nP 8uhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=UlXDXmyQM42NIbRxxJLUShi7TvU3NDi4ghYadEJeUGE=; b=MhOpI4BLSSiUHYTus1L1nSBwSNG1i/Qmd4XbJxj1TGIGzutRKm++bTW8lVY1JuJzvy G+tHHgPV0fVUMaA6NQ1Mf73O83BbRkeqfiPR6VJUgOeH88HXx9bSxv3sNsNvlDJgF9Y4 K9UPiJ02U0g81hL0UAzXMltjmZXZpBSXZApRoQ81AG3LIGqF8wQKNxqyQ2liytY2xWBv C14aTDYqszamXNZMVkbMR0vexpTp8u6rR+L3qMlpoFM65tOtagta56R1zLsY+/xbBeUw ILOuvaWT7IX2jM4AsEuxWLLL8Fk3IEKb2iWvfGGG0sqLtEqtcYSGVNEpWh+dCPBOXiGr Cm5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si27444309eda.178.2021.10.17.12.45.46; Sun, 17 Oct 2021 12:46:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242860AbhJOTwr (ORCPT + 99 others); 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