]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: hwpoison: fix action_result() to print out dirty/clean
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Fri, 9 Nov 2012 03:04:20 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Nov 2012 03:08:43 +0000 (14:08 +1100)
commitce2b8c721f3472f99dd1926cca8d906b9fa7d614
treef58914bdf4f21a2d50d79850085ed88fa47db57a
parent17925d6306f3f3ffbbafbd479320cb37a3d4b5e5
mm: hwpoison: fix action_result() to print out dirty/clean

action_result() fails to print out "dirty" even if an error occurred on a
dirty pagecache, because when we check PageDirty in action_result() it was
cleared after page isolation even if it's dirty before error handling.
This can break some applications that monitor this message, so should be
fixed.

There are several callers of action_result() except page_action(), but
either of them are not for LRU pages but for free pages or kernel pages,
so we don't have to consider dirty or not for them.

Note that PG_dirty can be set outside page locks as described in commit
6746aff74da29 ("HWPOISON: shmem: call set_page_dirty() with locked page"),
so this patch does not completely closes the race window, but just narrows
it.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c