Re: [PATCH v4 2/3] KEYS: Replace assoc_array with rhashtable

From: Jarkko Sakkinen

Date: Sun Nov 01 2026 - 20:04:08 EST


On Mon, Nov 02, 2026 at 02:04:07AM +0200, Jarkko Sakkinen wrote:
> > The commit message should mention explicitly whether there are any
> > userspace-visible behavior changes or not.
> >
> > KEYCTL_READ now outputs in insertion order, not hash order, right? And
> > likewise for the search order of sibling keyrings. Those differences
> > should be fine, but they should be mentioned. Any other changes?
>
> Keyrings are prepended, keys are appended, and while linking a key a
> match with type, description and domain retains its place.
>
> Right now any other major changes don't come to mind but yeah that
> can be broken down a bit.

key_unlink(), keyring_clear(), keyring_revoke(), and keyring_gc() don't
allocate memory.

That is worth of mentioning too probably as it is in favor of this
change.

And because rhashtable_destroy() can sleep queue_rcu_work() is used
instead of call_rcu().

Hmm... and rhashtable_insert_fast() can cause transient -EBUSY, which
is probably acceptable.

Br, Jarkko