client: safeguard memory barriers in loop

This commit is contained in:
Thomas Schoebel-Theuer 2022-02-17 17:21:42 +01:00 committed by Thomas Schoebel-Theuer
parent 0cec4c4841
commit 382d7be160
1 changed files with 3 additions and 1 deletions

View File

@ -782,7 +782,9 @@ void _do_timeout(struct client_output *output, struct list_head *anchor, int *ro
io_timeout *= HZ;
mutex_lock(&output->mutex);
for (tmp = anchor->prev, prev = tmp->prev; tmp != anchor; tmp = prev, prev = tmp->prev) {
for (tmp = READ_ONCE(anchor->prev), prev = READ_ONCE(tmp->prev);
tmp != anchor;
tmp = prev, prev = READ_ONCE(tmp->prev)) {
struct client_mref_aspect *mref_a;
mref_a = container_of(tmp, struct client_mref_aspect, io_head);