Skip to content

Commit 22f19f6

Browse files
committed
Merge tag 'xarray-5.18a' of git://git.infradead.org/users/willy/xarray
Pull xarray fixes from Matthew Wilcox: "Syzbot found a nasty race between large page splitting and page lookup. Details in the commit log, but fortunately it has a reliable reproducer. I thought it better to send this one to you straight away. Also fix the test suite build for kmem_cache_alloc_lru()" * tag 'xarray-5.18a' of git://git.infradead.org/users/willy/xarray: XArray: Disallow sibling entries of nodes tools: Add kmem_cache_alloc_lru()
2 parents 88c5060 + 63b1898 commit 22f19f6

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lib/xarray.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ static void *xas_descend(struct xa_state *xas, struct xa_node *node)
207207
if (xa_is_sibling(entry)) {
208208
offset = xa_to_sibling(entry);
209209
entry = xa_entry(xas->xa, node, offset);
210+
if (node->shift && xa_is_node(entry))
211+
entry = XA_RETRY_ENTRY;
210212
}
211213

212214
xas->xa_offset = offset;

tools/include/linux/slab.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ static inline void *kzalloc(size_t size, gfp_t gfp)
2828
return kmalloc(size, gfp | __GFP_ZERO);
2929
}
3030

31-
void *kmem_cache_alloc(struct kmem_cache *cachep, int flags);
31+
struct list_lru;
32+
33+
void *kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *, int flags);
34+
static inline void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
35+
{
36+
return kmem_cache_alloc_lru(cachep, NULL, flags);
37+
}
3238
void kmem_cache_free(struct kmem_cache *cachep, void *objp);
3339

3440
struct kmem_cache *kmem_cache_create(const char *name, unsigned int size,

tools/testing/radix-tree/linux.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ struct kmem_cache {
2525
void (*ctor)(void *);
2626
};
2727

28-
void *kmem_cache_alloc(struct kmem_cache *cachep, int gfp)
28+
void *kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru,
29+
int gfp)
2930
{
3031
void *p;
3132

0 commit comments

Comments
 (0)