inotify: report both events on parent and child with single callback
[linux-2.6-microblaze.git] / mm / page_isolation.c
index 2c11a38..f6d07c5 100644 (file)
@@ -151,6 +151,7 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages)
  *                     a bit mask)
  *                     MEMORY_OFFLINE - isolate to offline (!allocate) memory
  *                                      e.g., skip over PageHWPoison() pages
+ *                                      and PageOffline() pages.
  *                     REPORT_FAILURE - report details about the failure to
  *                     isolate the range
  *
@@ -259,6 +260,14 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
                else if ((flags & MEMORY_OFFLINE) && PageHWPoison(page))
                        /* A HWPoisoned page cannot be also PageBuddy */
                        pfn++;
+               else if ((flags & MEMORY_OFFLINE) && PageOffline(page) &&
+                        !page_count(page))
+                       /*
+                        * The responsible driver agreed to skip PageOffline()
+                        * pages when offlining memory by dropping its
+                        * reference in MEM_GOING_OFFLINE.
+                        */
+                       pfn++;
                else
                        break;
        }