linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zeno Endemann <zeno.endemann@mailbox.org>
To: linux-ext4@vger.kernel.org
Subject: ext4: Question about directory entry minor hash usage (documentation error?)
Date: Wed, 24 Sep 2025 18:04:08 +0200	[thread overview]
Message-ID: <51a89ced-228d-4fd0-9613-3b4d027d9162@mailbox.org> (raw)

Hello,

The documentation of hash tree directories claims that interior nodes are
"indexed by a minor hash".

However from my current understanding of the code, it seems to me the node
splitting works somewhat like regular B-trees, and there is no re-sorting
with a minor hash going on. The minor hash doesn't influence at all the
on-disk data structure, and is only used for sorting in a kernel internal
rb-tree. Is this correct? If so, I could offer to write up a patch for the
documentation.

As a side question, I was wondering a bit why the kernel differentiates
between htree-indexed dirs and others when simply iterating over it (as in
e.g. ext4_readdir), and what the point of that rb-tree there is, i.e. why one
would want to iterate over the entries in hash tree order.


Thanks and cheers,
Zeno Endemann

             reply	other threads:[~2025-09-24 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 16:04 Zeno Endemann [this message]
2025-09-24 19:37 ` ext4: Question about directory entry minor hash usage (documentation error?) Theodore Ts'o
2025-09-25 15:58   ` Zeno Endemann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51a89ced-228d-4fd0-9613-3b4d027d9162@mailbox.org \
    --to=zeno.endemann@mailbox.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).