]> 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>
Mon, 12 Nov 2012 04:17:05 +0000 (15:17 +1100)
commit5127d6c32d636f31f53e54ea5d30e84131a38db0
treef852dc06af913b370c03e90f45e2ac109a152fd2
parentf4a1b5668a283ff0e2685b4d87899726d90ec4c5
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