HWPOISON: Turn ref argument into flags argument
[deliverable/linux.git] / mm / memory-failure.c
index 275f4e2df8ac4f8ff05ca5f9e5a784a6ee41921d..3338c443272c8ea8bf434daec43ab369bed86e98 100644 (file)
@@ -627,7 +627,7 @@ static void action_result(unsigned long pfn, char *msg, int result)
 }
 
 static int page_action(struct page_state *ps, struct page *p,
-                       unsigned long pfn, int ref)
+                       unsigned long pfn)
 {
        int result;
        int count;
@@ -635,7 +635,7 @@ static int page_action(struct page_state *ps, struct page *p,
        result = ps->action(p, pfn);
        action_result(pfn, ps->msg, result);
 
-       count = page_count(p) - 1 - ref;
+       count = page_count(p) - 1;
        if (count != 0)
                printk(KERN_ERR
                       "MCE %#lx: %s page still referenced by %d users\n",
@@ -737,7 +737,7 @@ static void hwpoison_user_mappings(struct page *p, unsigned long pfn,
                      ret != SWAP_SUCCESS, pfn);
 }
 
-int __memory_failure(unsigned long pfn, int trapno, int ref)
+int __memory_failure(unsigned long pfn, int trapno, int flags)
 {
        unsigned long lru_flag;
        struct page_state *ps;
@@ -773,7 +773,8 @@ int __memory_failure(unsigned long pfn, int trapno, int ref)
         * In fact it's dangerous to directly bump up page count from 0,
         * that may make page_freeze_refs()/page_unfreeze_refs() mismatch.
         */
-       if (!get_page_unless_zero(compound_head(p))) {
+       if (!(flags & MF_COUNT_INCREASED) &&
+               !get_page_unless_zero(compound_head(p))) {
                action_result(pfn, "free or high order kernel", IGNORED);
                return PageBuddy(compound_head(p)) ? 0 : -EBUSY;
        }
@@ -821,7 +822,7 @@ int __memory_failure(unsigned long pfn, int trapno, int ref)
        res = -EBUSY;
        for (ps = error_states;; ps++) {
                if (((p->flags | lru_flag)& ps->mask) == ps->res) {
-                       res = page_action(ps, p, pfn, ref);
+                       res = page_action(ps, p, pfn);
                        break;
                }
        }
This page took 0.027852 seconds and 5 git commands to generate.