The patch titled ksm: fix losing visibility of part of rmap_item->next list has been removed from the -mm tree. Its filename was ksm-add-replace_page-change-the-page-pte-is-pointing-to-fix-losing-visibility-of-part-of-rmap_item-next-list.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: ksm: fix losing visibility of part of rmap_item->next list From: Andrea Arcangeli <aarcange@xxxxxxxxxx> The tree_item->rmap_item is the head of the list and as such it must not be overwritten except in the case that the element we removed (rmap_item) was the previous head of the list, in which case it would also have rmap_item->prev set to null. Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Izik Eidus <ieidus@xxxxxxxxxx> Cc: Chris Wright <chrisw@xxxxxxxxxx> Cc: Avi Kivity <avi@xxxxxxxxxx> Cc: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/ksm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN mm/ksm.c~ksm-add-replace_page-change-the-page-pte-is-pointing-to-fix-losing-visibility-of-part-of-rmap_item-next-list mm/ksm.c --- a/mm/ksm.c~ksm-add-replace_page-change-the-page-pte-is-pointing-to-fix-losing-visibility-of-part-of-rmap_item-next-list +++ a/mm/ksm.c @@ -397,10 +397,10 @@ static void remove_rmap_item_from_tree(s free_tree_item(tree_item); nnodes_stable_tree--; } else if (!rmap_item->prev) { + BUG_ON(tree_item->rmap_item != rmap_item); tree_item->rmap_item = rmap_item->next; - } else { - tree_item->rmap_item = rmap_item->prev; - } + } else + BUG_ON(tree_item->rmap_item == rmap_item); } else { /* * We dont rb_erase(&tree_item->node) here, beacuse _ Patches currently in -mm which might be from aarcange@xxxxxxxxxx are linux-next.patch ksm-add-replace_page-change-the-page-pte-is-pointing-to-fix-losing-visibility-of-part-of-rmap_item-next-list.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html