From: Andrew Morton Date: Thu, 24 Aug 2023 22:25:56 +0000 (-0700) Subject: merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fcbc329fa39ef261ba9072c56c63563423bff798;p=linux.git merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes --- fcbc329fa39ef261ba9072c56c63563423bff798 diff --cc lib/maple_tree.c index ffb9d15bd8152,f723024e14266..05d5db255c398 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@@ -4107,12 -4265,16 +4107,16 @@@ static inline unsigned char mas_wr_new_ * mas_wr_append: Attempt to append * @wr_mas: the maple write state * + * This is currently unsafe in rcu mode since the end of the node may be cached + * by readers while the node contents may be updated which could result in + * inaccurate information. + * * Return: True if appended, false otherwise */ -static inline bool mas_wr_append(struct ma_wr_state *wr_mas) +static inline bool mas_wr_append(struct ma_wr_state *wr_mas, + unsigned char new_end) { unsigned char end = wr_mas->node_end; - unsigned char new_end = end + 1; struct ma_state *mas = wr_mas->mas; unsigned char node_pivots = mt_pivots[wr_mas->type];