Commit 3d81acb1 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk

Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"

This reverts commit b960d6c4.

If we have another thread (very likely) touched the list, we
end up hitting a problem "that the next element is wrong because
we should be able to cope with that. The problem is that the
next->next pointer would be set LIST_POISON1. " (Stefano's
comment on the patch).

Reverting for now.
Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 186bab1c
...@@ -809,17 +809,21 @@ struct page *m2p_find_override(unsigned long mfn) ...@@ -809,17 +809,21 @@ struct page *m2p_find_override(unsigned long mfn)
{ {
unsigned long flags; unsigned long flags;
struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)]; struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
struct page *p, *t, *ret; struct page *p, *ret;
ret = NULL; ret = NULL;
list_for_each_entry_safe(p, t, bucket, lru) { spin_lock_irqsave(&m2p_override_lock, flags);
list_for_each_entry(p, bucket, lru) {
if (page_private(p) == mfn) { if (page_private(p) == mfn) {
ret = p; ret = p;
break; break;
} }
} }
spin_unlock_irqrestore(&m2p_override_lock, flags);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment