]> git.baikalelectronics.ru Git - kernel.git/commit
XArray: Fix xa_alloc when id exceeds max
authorMatthew Wilcox <willy@infradead.org>
Thu, 13 Dec 2018 18:57:42 +0000 (13:57 -0500)
committerMatthew Wilcox <willy@infradead.org>
Thu, 13 Dec 2018 19:07:33 +0000 (14:07 -0500)
commit14bec2a9a4a769acb0d3043b5f5176dced69d77a
treeefd9c5d74cf60cdd6ff5c5f618f74e6fffed0493
parent4d09deef0e4e3c11986957d9fa7f1fca81fc27de
XArray: Fix xa_alloc when id exceeds max

Specifying a starting ID greater than the maximum ID isn't something
attempted very often, but it should fail.  It was succeeding due to
xas_find_marked() returning the wrong error state, so add tests for
both xa_alloc() and xas_find_marked().

Fixes: 33d38ebb0fe5 ("xarray: Add XArray iterators")
Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/test_xarray.c
lib/xarray.c