Cyrill Gorcunov 6dec97dc92 mm: move_ptes -- Set soft dirty bit depending on pte type
Dave reported corrupted swap entries

 | [ 4588.541886] swap_free: Unused swap offset entry 00002d15
 | [ 4588.541952] BUG: Bad page map in process trinity-kid12  pte:005a2a80 pmd:22c01f067

and Hugh pointed that in move_ptes _PAGE_SOFT_DIRTY bit set regardless
the type of entry pte consists of.  The trick here is that when we carry
soft dirty status in swap entries we are to use _PAGE_SWP_SOFT_DIRTY
instead, because this is the only place in pte which can be used for own
needs without intersecting with bits owned by swap entry type/offset.

Reported-and-tested-by: Dave Jones <davej@redhat.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Analyzed-by: Hugh Dickins <hughd@google.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-27 09:36:17 -07:00
..
2013-07-16 10:57:36 -07:00
2013-07-03 16:07:39 -07:00
2012-01-03 22:54:56 -05:00
2011-07-26 16:49:47 -07:00
2013-07-09 10:33:22 -07:00
2013-07-10 18:11:34 -07:00
2013-07-10 18:11:34 -07:00
2013-06-28 14:34:33 +02:00
2013-02-23 17:50:18 -08:00
2010-05-21 18:31:21 -04:00
2013-07-10 18:11:34 -07:00
2012-06-20 14:39:36 -07:00
2013-08-13 17:57:48 -07:00
2013-07-10 18:11:34 -07:00
2013-07-10 18:11:34 -07:00