ARM: dts: bcm2711-rpi-4-b: add a brcmf wifi node
[platform/kernel/linux-rpi.git] / mm / memory-failure.c
index 5d880d4..570a20b 100644 (file)
@@ -989,7 +989,7 @@ static int get_hwpoison_page(struct page *page)
 static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
                                  int flags, struct page **hpagep)
 {
-       enum ttu_flags ttu = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS;
+       enum ttu_flags ttu = TTU_IGNORE_MLOCK;
        struct address_space *mapping;
        LIST_HEAD(tokill);
        bool unmap_success = true;
@@ -1231,6 +1231,18 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
        loff_t start;
        dax_entry_t cookie;
 
+       if (flags & MF_COUNT_INCREASED)
+               /*
+                * Drop the extra refcount in case we come from madvise().
+                */
+               put_page(page);
+
+       /* device metadata space is not recoverable */
+       if (!pgmap_pfn_valid(pgmap, pfn)) {
+               rc = -ENXIO;
+               goto out;
+       }
+
        /*
         * Prevent the inode from being freed while we are interrogating
         * the address_space, typically this would be handled by