Merge branch 'mutex-ops@next-for-chris' of git://github.com/idryomov/btrfs-unstable...
[deliverable/linux.git] / mm / memory-failure.c
index 6c5899b9034aa7d769e5fd80e139cad61af104c0..8b20278be6a62fa49a23615cf5bee60bd71b0ed0 100644 (file)
@@ -1476,9 +1476,17 @@ int soft_offline_page(struct page *page, int flags)
 {
        int ret;
        unsigned long pfn = page_to_pfn(page);
+       struct page *hpage = compound_trans_head(page);
 
        if (PageHuge(page))
                return soft_offline_huge_page(page, flags);
+       if (PageTransHuge(hpage)) {
+               if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
+                       pr_info("soft offline: %#lx: failed to split THP\n",
+                               pfn);
+                       return -EBUSY;
+               }
+       }
 
        ret = get_any_page(page, pfn, flags);
        if (ret < 0)
This page took 0.038434 seconds and 5 git commands to generate.