rbd: disallow read-write partitions on images mapped read-only
[linux-2.6-microblaze.git] / mm / madvise.c
index 2be9f3f..94c343b 100644 (file)
@@ -363,8 +363,12 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
                ClearPageReferenced(page);
                test_and_clear_page_young(page);
                if (pageout) {
-                       if (!isolate_lru_page(page))
-                               list_add(&page->lru, &page_list);
+                       if (!isolate_lru_page(page)) {
+                               if (PageUnevictable(page))
+                                       putback_lru_page(page);
+                               else
+                                       list_add(&page->lru, &page_list);
+                       }
                } else
                        deactivate_page(page);
 huge_unlock:
@@ -441,8 +445,12 @@ regular_page:
                ClearPageReferenced(page);
                test_and_clear_page_young(page);
                if (pageout) {
-                       if (!isolate_lru_page(page))
-                               list_add(&page->lru, &page_list);
+                       if (!isolate_lru_page(page)) {
+                               if (PageUnevictable(page))
+                                       putback_lru_page(page);
+                               else
+                                       list_add(&page->lru, &page_list);
+                       }
                } else
                        deactivate_page(page);
        }