Merge tag 'nfsd-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
[linux-2.6-microblaze.git] / mm / memory-failure.c
index 145bb56..bead6bc 100644 (file)
@@ -1080,6 +1080,7 @@ static int me_huge_page(struct page_state *ps, struct page *p)
        int res;
        struct page *hpage = compound_head(p);
        struct address_space *mapping;
+       bool extra_pins = false;
 
        if (!PageHuge(hpage))
                return MF_DELAYED;
@@ -1087,6 +1088,8 @@ static int me_huge_page(struct page_state *ps, struct page *p)
        mapping = page_mapping(hpage);
        if (mapping) {
                res = truncate_error_page(hpage, page_to_pfn(p), mapping);
+               /* The page is kept in page cache. */
+               extra_pins = true;
                unlock_page(hpage);
        } else {
                unlock_page(hpage);
@@ -1104,7 +1107,7 @@ static int me_huge_page(struct page_state *ps, struct page *p)
                }
        }
 
-       if (has_extra_refcount(ps, p, false))
+       if (has_extra_refcount(ps, p, extra_pins))
                res = MF_FAILED;
 
        return res;