Skip to content

Commit

Permalink
HWPOISON: return 0 to indicate success reliably
Browse files Browse the repository at this point in the history
Return 0 to indicate success, when
- action result is RECOVERED or DELAYED
- no extra page reference

Note that dirty swapcache pages are kept in swapcache, so can have one
more reference count.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Wu Fengguang authored and Andi Kleen committed Dec 16, 2009
1 parent d95ea51 commit 138ce28
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,17 +654,21 @@ static int page_action(struct page_state *ps, struct page *p,
action_result(pfn, ps->msg, result);

count = page_count(p) - 1;
if (count != 0)
if (ps->action == me_swapcache_dirty && result == DELAYED)
count--;
if (count != 0) {
printk(KERN_ERR
"MCE %#lx: %s page still referenced by %d users\n",
pfn, ps->msg, count);
result = FAILED;
}

/* Could do more checks here if page looks ok */
/*
* Could adjust zone counters here to correct for the missing page.
*/

return result == RECOVERED ? 0 : -EBUSY;
return (result == RECOVERED || result == DELAYED) ? 0 : -EBUSY;
}

#define N_UNMAP_TRIES 5
Expand Down

0 comments on commit 138ce28

Please sign in to comment.