]> git.ipfire.org Git - thirdparty/linux.git/commit - lib/test_xarray.c
XArray: add cmpxchg order test
authorDaniel Gomez <da.gomez@samsung.com>
Wed, 31 Jan 2024 22:51:25 +0000 (14:51 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:48 +0000 (10:24 -0800)
commite777ae44e33e48ad01bfdc978076b03c1f091b4f
tree19b71e20301971dcdfe29caa46eaee03a3e9893f
parenta60cc288a1a2604bd86d3df129f269887018c3cb
XArray: add cmpxchg order test

XArray multi-index entries do not keep track of the order stored once the
entry is being marked as used with cmpxchg (conditionally replaced with
NULL).  Add a test to check the order is actually lost.  The test also
verifies the order and entries for all the tied indexes before and after
the NULL replacement with xa_cmpxchg.

Add another entry at 1 << order that keeps the node around and the order
information for the NULL-entry after xa_cmpxchg.

Link: https://lkml.kernel.org/r/20240131225125.1370598-3-mcgrof@kernel.org
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_xarray.c