The patch titled Subject: XArray: fix xa_to_node by adding xa_is_node has been added to the -mm tree. Its filename is xarray-fix-xa_to_node-by-adding-xa_is_node.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/xarray-fix-xa_to_node-by-adding-xa_is_node.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/xarray-fix-xa_to_node-by-adding-xa_is_node.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jiasheng Jiang <jiasheng@xxxxxxxxxxx> Subject: XArray: fix xa_to_node by adding xa_is_node Directly using xa_to_node may lead to the compulsory type conversion of unknown type,which is unsafe. So it might be better that adding xa_is_node before. Link: https://lkml.kernel.org/r/1634028170-1753612-1-git-send-email-jiasheng@xxxxxxxxxxx Fixes: 58d6ea3 ("xarray: Add XArray unconditional store operations") Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/test_xarray.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/lib/test_xarray.c~xarray-fix-xa_to_node-by-adding-xa_is_node +++ a/lib/test_xarray.c @@ -606,8 +606,10 @@ static noinline void check_multi_store(s XA_BUG_ON(xa, xa_load(xa, 1) != xa_mk_value(0)); XA_BUG_ON(xa, xa_load(xa, 2) != NULL); rcu_read_lock(); - XA_BUG_ON(xa, xa_to_node(xa_head(xa))->count != 2); - XA_BUG_ON(xa, xa_to_node(xa_head(xa))->nr_values != 2); + if (xa_is_node(xa_head(xa))) { + XA_BUG_ON(xa, xa_to_node(xa_head(xa))->count != 2); + XA_BUG_ON(xa, xa_to_node(xa_head(xa))->nr_values != 2); + } rcu_read_unlock(); /* Storing adjacent to the value does not alter the value */ _ Patches currently in -mm which might be from jiasheng@xxxxxxxxxxx are xarray-fix-xa_to_node-by-adding-xa_is_node.patch