mirror of https://lore.kernel.org/lkml/
 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; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ 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 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®