]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
XArray tests: RCU lock prohibits GFP_KERNEL
authorMatthew Wilcox <willy@infradead.org>
Tue, 5 Feb 2019 04:12:08 +0000 (23:12 -0500)
committerMatthew Wilcox <willy@infradead.org>
Tue, 5 Feb 2019 04:15:30 +0000 (23:15 -0500)
Drop and reacquire the RCU read lock while using GFP_KERNEL.

Reported-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/test_xarray.c

index c596a957f7643e56b45956a61ed999980568ad53..671a93ee09e6017c098ae684f726b6615d629629 100644 (file)
@@ -107,8 +107,11 @@ static noinline void check_xas_retry(struct xarray *xa)
        XA_BUG_ON(xa, xas.xa_node != XAS_RESTART);
        XA_BUG_ON(xa, xas_next_entry(&xas, ULONG_MAX) != xa_mk_value(0));
        XA_BUG_ON(xa, xas.xa_node != NULL);
+       rcu_read_unlock();
 
        XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_KERNEL) != NULL);
+
+       rcu_read_lock();
        XA_BUG_ON(xa, !xa_is_internal(xas_reload(&xas)));
        xas.xa_node = XAS_RESTART;
        XA_BUG_ON(xa, xas_next_entry(&xas, ULONG_MAX) != xa_mk_value(0));