[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF1vpkiK6=gvqD27sLaDnB79ekjKzYjwEP5=u9+D_mQi_5oJwA@mail.gmail.com>
Date: Mon, 18 Oct 2021 19:56:13 +0300
From: Avi Deitcher <avi@...tcher.net>
To: "Theodore Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org
Subject: Re: algorithm for half-md4 used in htree directories
Yes, it definitely was my silly use of sizeof() instead of strlen().
Switch to strlen(), and my test program's output (using little-endian
for each u32) gives the exact same output.
Looks like I owe you that beer (and happy to share it with you) next
time we are in the same place!
On Fri, Oct 15, 2021 at 10:50 PM Theodore Ts'o <tytso@....edu> wrote:
>
> 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
--
Avi Deitcher
avi@...tcher.net
Follow me http://twitter.com/avideitcher
Read me http://blog.atomicinc.com
Powered by blists - more mailing lists