aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-20 11:50:30 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-20 11:56:00 -0400
commit3d81acb1cdb242378a1acb3eb1bc28c6bb5895f1 (patch)
tree74a155c6e4e051cf7322168c7293fbee543131c2
parent186bab1ce04f99153b7eeb3348438b654c24c24b (diff)
Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"
This reverts commit b960d6c43a63ebd2d8518b328da3816b833ee8cc. 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>
-rw-r--r--arch/x86/xen/p2m.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 7ed8cc3434c5..1b267e75158d 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -809,17 +809,21 @@ struct page *m2p_find_override(unsigned long mfn)
809{ 809{
810 unsigned long flags; 810 unsigned long flags;
811 struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)]; 811 struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
812 struct page *p, *t, *ret; 812 struct page *p, *ret;
813 813
814 ret = NULL; 814 ret = NULL;
815 815
816 list_for_each_entry_safe(p, t, bucket, lru) { 816 spin_lock_irqsave(&m2p_override_lock, flags);
817
818 list_for_each_entry(p, bucket, lru) {
817 if (page_private(p) == mfn) { 819 if (page_private(p) == mfn) {
818 ret = p; 820 ret = p;
819 break; 821 break;
820 } 822 }
821 } 823 }
822 824
825 spin_unlock_irqrestore(&m2p_override_lock, flags);
826
823 return ret; 827 return ret;
824} 828}
825 829