All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix page_list_splice()
@ 2012-06-06  8:23 Jan Beulich
  2012-06-06  9:02 ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2012-06-06  8:23 UTC (permalink / raw)
  To: xen-devel; +Cc: Jisoo Yang

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

Other than in __list_splice(), the first element's prev pointer doesn't
need adjustment here - it already is PAGE_LIST_NULL. Rather than fixing
the assignment (to formally match __list_splice()), simply assert that
this assignment is really unnecessary.

Reported-by: Jisoo Yang <jisooy@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -270,7 +270,8 @@ page_list_splice(struct page_list_head *
     last = list->tail;
     at = head->next;
 
-    first->list.prev = page_to_pdx(head->next);
+    /* Both first->list.prev and at->list.prev are PAGE_LIST_NULL. */
+    ASSERT(first->list.prev == at->list.prev);
     head->next = first;
 
     last->list.next = page_to_pdx(at);




[-- Attachment #2: page-list-splice.patch --]
[-- Type: text/plain, Size: 790 bytes --]

fix page_list_splice()

Other than in __list_splice(), the first element's prev pointer doesn't
need adjustment here - it already is PAGE_LIST_NULL. Rather than fixing
the assignment (to formally match __list_splice()), simply assert that
this assignment is really unnecessary.

Reported-by: Jisoo Yang <jisooy@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -270,7 +270,8 @@ page_list_splice(struct page_list_head *
     last = list->tail;
     at = head->next;
 
-    first->list.prev = page_to_pdx(head->next);
+    /* Both first->list.prev and at->list.prev are PAGE_LIST_NULL. */
+    ASSERT(first->list.prev == at->list.prev);
     head->next = first;
 
     last->list.next = page_to_pdx(at);

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-08  7:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06  8:23 [PATCH] fix page_list_splice() Jan Beulich
2012-06-06  9:02 ` Keir Fraser
2012-06-06  9:26   ` Jan Beulich
2012-06-06 11:22     ` Keir Fraser
2012-06-07 19:10       ` Jan Beulich
2012-06-08  7:51         ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.