All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lib/assoc_array: fix root-shortcut split lookup regression, add KUnit tests
@ 2026-11-16  5:41 William Chuang
  2026-11-16  5:41 ` [PATCH 1/2] lib/assoc_array: add KUnit test suite William Chuang
  2026-11-16  5:41 ` [PATCH 2/2] lib/assoc_array: fix lookups after splitting a root shortcut William Chuang
  0 siblings, 2 replies; 5+ messages in thread
From: William Chuang @ 2026-11-16  5:41 UTC (permalink / raw)
  To: akpm; +Cc: dhowells, keyrings, linux-kernel, William Chuang

This series adds a KUnit test suite for lib/assoc_array.c and fixes a
lookup bug that suite exposes.

When a root shortcut is split at the first level-segment boundary, the
replacement node is installed one segment too shallow. Lookups then walk
the tree at the wrong depth, so a fraction of previously inserted keys can
no longer be found, even though they remain in the array.

Patch 1 adds the test suite; it passes on mainline. Patch 2 fixes the
split path in assoc_array_insert() and adds a regression test that fails
without the fix, keeping the series bisection-clean.

The fix was checked by exhaustive fan-out enumeration, randomized stress
runs, and KASAN; the patch 2 commit message describes the mechanism in
detail.

William Chuang (2):
  lib/assoc_array: add KUnit test suite
  lib/assoc_array: fix lookups after splitting a root shortcut

 lib/Kconfig.debug             |  17 +
 lib/assoc_array.c             |   3 +-
 lib/tests/Makefile            |   1 +
 lib/tests/assoc_array_kunit.c | 991 ++++++++++++++++++++++++++++++++++
 4 files changed, 1011 insertions(+), 1 deletion(-)
 create mode 100644 lib/tests/assoc_array_kunit.c

-- 
2.39.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-16 20:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  5:41 [PATCH 0/2] lib/assoc_array: fix root-shortcut split lookup regression, add KUnit tests William Chuang
2026-11-16  5:41 ` [PATCH 1/2] lib/assoc_array: add KUnit test suite William Chuang
2026-11-16  5:51   ` sashiko-bot
2026-11-16 20:28   ` kernel test robot
2026-11-16  5:41 ` [PATCH 2/2] lib/assoc_array: fix lookups after splitting a root shortcut William Chuang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.