On Sun, Mar 03, 2024 at 12:11:05PM +0000, Matthew Wilcox wrote: > On Sat, Mar 02, 2024 at 10:13:28PM +0800, Han Xing Yi wrote: > > Hello! This is my first patch ever, so please bear with me if I make some rookie > > mistakes. I've tried my best to follow the documentation :) > > Thanks! This is indeed a mistake. Probably a harmless one, but worth > fixing to silence the warning. Yeah, it is probably harmless since the RCU write means that either the old or new value will be read, but not a temporary value. Thanks for pointing this out! > Annoyingly, building with C=1 (sparse) finds the problem: > > CHECK ../lib/xarray.c > ../lib/xarray.c:1779:54: warning: incorrect type in argument 1 (different address spaces) > ../lib/xarray.c:1779:54: expected void const *entry > ../lib/xarray.c:1779:54: got void [noderef] __rcu * > > so that means I got out of the habit of running sparse, and for some > reason none of the build bots notified me of the new warning (or I > missed that email). I'm so sorry for this mistake, I did not build the kernel with sparse when testing the patch. I'll be sure to do that next time around. > This is such a common thing to do that I have a helper for it. > So what I'll actually commit is: > > - if (!xa_is_sibling(xas.xa_node->slots[slot])) > + if (!xa_is_sibling(xa_entry(xas.xa, xas.xa_node, slot))) > > but I'll leave your name on it since you did the actual work. Thank you so much for fixing my mistakes and your quick response on this, I really appreciate it :)