XArray tests: Add RCU locking
authorMatthew Wilcox <willy@infradead.org>
Mon, 17 Dec 2018 22:37:25 +0000 (17:37 -0500)
committerMatthew Wilcox <willy@infradead.org>
Mon, 7 Jan 2019 02:24:43 +0000 (21:24 -0500)
0day picked up that I'd forgotten to add locking to this new test.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/test_xarray.c

index 4676c0a1eeca0f7f7c559176b2c580cedcccce6d..a885afde0aef1a0187c3332538710befad1ad6f4 100644 (file)
@@ -839,6 +839,7 @@ static noinline void check_find_3(struct xarray *xa)
 
        for (i = 0; i < 100; i++) {
                for (j = 0; j < 100; j++) {
+                       rcu_read_lock();
                        for (k = 0; k < 100; k++) {
                                xas_set(&xas, j);
                                xas_for_each_marked(&xas, entry, k, XA_MARK_0)
@@ -847,6 +848,7 @@ static noinline void check_find_3(struct xarray *xa)
                                        XA_BUG_ON(xa,
                                                xas.xa_node != XAS_RESTART);
                        }
+                       rcu_read_unlock();
                }
                xa_store_index(xa, i, GFP_KERNEL);
                xa_set_mark(xa, i, XA_MARK_0);