Skip to content

Commit

Permalink
Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"
Browse files Browse the repository at this point in the history
This reverts commit b960d6c.

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: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
konradwilk committed Apr 20, 2012
1 parent 186bab1 commit 3d81acb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,17 +809,21 @@ struct page *m2p_find_override(unsigned long mfn)
{
unsigned long flags;
struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
struct page *p, *t, *ret;
struct page *p, *ret;

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) {
ret = p;
break;
}
}

spin_unlock_irqrestore(&m2p_override_lock, flags);

return ret;
}

Expand Down

0 comments on commit 3d81acb

Please sign in to comment.