diff options
author | Joel Stanley <joel@jms.id.au> | 2019-12-12 01:32:01 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2019-12-12 01:32:06 +0300 |
commit | fdc60468f3e452364d432f1a7c3f83d58bba1b84 (patch) | |
tree | de7197f150958ae72cb87b6cf4885610f3edd704 /lib/test_xarray.c | |
parent | 20572eecd7248b66d855a8e4812debd9f828ccba (diff) | |
parent | 8539dfa4fcbcf58c3c2f92ac57b964add884d12b (diff) | |
download | linux-dev-5.3.tar.xz |
Merge tag 'v5.3.15' into dev-5.3dev-5.3
This is the 5.3.15 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'lib/test_xarray.c')
-rw-r--r-- | lib/test_xarray.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/test_xarray.c b/lib/test_xarray.c index 9d631a7b6a70..7df4f7f395bf 100644 --- a/lib/test_xarray.c +++ b/lib/test_xarray.c @@ -1110,6 +1110,28 @@ static noinline void check_find_entry(struct xarray *xa) XA_BUG_ON(xa, !xa_empty(xa)); } +static noinline void check_move_tiny(struct xarray *xa) +{ + XA_STATE(xas, xa, 0); + + XA_BUG_ON(xa, !xa_empty(xa)); + rcu_read_lock(); + XA_BUG_ON(xa, xas_next(&xas) != NULL); + XA_BUG_ON(xa, xas_next(&xas) != NULL); + rcu_read_unlock(); + xa_store_index(xa, 0, GFP_KERNEL); + rcu_read_lock(); + xas_set(&xas, 0); + XA_BUG_ON(xa, xas_next(&xas) != xa_mk_index(0)); + XA_BUG_ON(xa, xas_next(&xas) != NULL); + xas_set(&xas, 0); + XA_BUG_ON(xa, xas_prev(&xas) != xa_mk_index(0)); + XA_BUG_ON(xa, xas_prev(&xas) != NULL); + rcu_read_unlock(); + xa_erase_index(xa, 0); + XA_BUG_ON(xa, !xa_empty(xa)); +} + static noinline void check_move_small(struct xarray *xa, unsigned long idx) { XA_STATE(xas, xa, 0); @@ -1217,6 +1239,8 @@ static noinline void check_move(struct xarray *xa) xa_destroy(xa); + check_move_tiny(xa); + for (i = 0; i < 16; i++) check_move_small(xa, 1UL << i); |