On 12/5/22 15:15, Mike Pattrick wrote: > On Mon, Dec 5, 2022 at 3:41 AM Adrian Moreno <[email protected]> wrote: >> >> The .prev member of a rculist should not be used directly by users >> because it's not rcu-safe. A convenient fake mutex (rculist_fake_mutex) >> helps ensuring that in conjunction with clang's thread safety >> extensions. >> >> Only writers with exclusive access to the rculist should access .prev >> via some of the provided *_protected() accessors. >> >> Use rculist_back_protected() in REVERSE_PROTECTED iterators to avoid >> clang's compilation warning. >> >> Signed-off-by: Adrian Moreno <[email protected]> > > This fixes the clang warning. > > Acked-by: Mike Pattrick <[email protected]>
I applied this one patch. Thanks! Also backported down to 2.13. The second one has a build issue on Windows. Best regards, Ilya Maximets. > >> --- >> lib/rculist.h | 8 +++++--- >> 1 file changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/lib/rculist.h b/lib/rculist.h >> index 9bb8cbf3e..6df963eb2 100644 >> --- a/lib/rculist.h >> +++ b/lib/rculist.h >> @@ -378,12 +378,14 @@ rculist_is_singleton_protected(const struct rculist >> *list) >> UPDATE_MULTIVAR(ITER, rculist_next(ITER_VAR(ITER)))) >> >> #define RCULIST_FOR_EACH_REVERSE_PROTECTED(ITER, MEMBER, RCULIST) >> \ >> - for (INIT_MULTIVAR(ITER, MEMBER, (RCULIST)->prev, struct rculist); >> \ >> + for (INIT_MULTIVAR(ITER, MEMBER, rculist_back_protected(RCULIST), >> \ >> + struct rculist); >> \ >> CONDITION_MULTIVAR(ITER, MEMBER, ITER_VAR(ITER) != (RCULIST)); >> \ >> - UPDATE_MULTIVAR(ITER, ITER_VAR(ITER)->prev)) >> + UPDATE_MULTIVAR(ITER, rculist_back_protected(ITER_VAR(ITER)))) >> >> #define RCULIST_FOR_EACH_REVERSE_PROTECTED_CONTINUE(ITER, MEMBER, RCULIST) >> \ >> - for (INIT_MULTIVAR(ITER, MEMBER, (ITER)->MEMBER.prev, struct rculist); >> \ >> + for (INIT_MULTIVAR(ITER, MEMBER, rculist_back_protected(ITER->MEMBER), >> \ >> + struct rculist); >> \ >> CONDITION_MULTIVAR(ITER, MEMBER, ITER_VAR(ITER) != (RCULIST)); >> \ >> UPDATE_MULTIVAR(ITER, ITER_VAR(ITER)->prev)) >> >> -- >> 2.38.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
