]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/memory-failure.c
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[karo-tx-linux.git] / mm / memory-failure.c
index a013bc94ebbed4af3764e396b087475310ed5185..8639f6b28746b313bcd12bca3693a11079e18143 100644 (file)
@@ -148,7 +148,7 @@ static int hwpoison_filter_task(struct page *p)
        ino = cgroup_ino(css->cgroup);
        css_put(css);
 
-       if (!ino || ino != hwpoison_filter_memcg)
+       if (ino != hwpoison_filter_memcg)
                return -EINVAL;
 
        return 0;
@@ -1172,6 +1172,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
 
        lock_page(hpage);
 
+       /*
+        * The page could have changed compound pages during the locking.
+        * If this happens just bail out.
+        */
+       if (compound_head(p) != hpage) {
+               action_result(pfn, "different compound page after locking", IGNORED);
+               res = -EBUSY;
+               goto out;
+       }
+
        /*
         * We use page flags to determine what action should be taken, but
         * the flags can be modified by the error containment action.  One