Spanning store detection needs to be more robust than checking if it spans the end of
a node. Fix the detection by using mas_is_span_wr(). Also ensure it's not MAS_NONE.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp)
{
- // Detect spanning store.
- if ((mas->last == mas->max && !entry) ||
- (mas->last > mas->max))
+ if (mas_is_span_wr(mas, mas->max, mte_node_type(mas->node), entry) ||
+ mas_is_none(mas))
mas->node = MAS_START;
retry: