aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 2e8c2b01d5d5..0d986c13d473 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -911,15 +911,24 @@ retry:
911 for (i = 0; i < nr_pages; i++) { 911 for (i = 0; i < nr_pages; i++) {
912 struct page *page = pvec.pages[i]; 912 struct page *page = pvec.pages[i];
913 913
914 done_index = page->index + 1;
915
916 /* 914 /*
917 * At this point we hold neither mapping->tree_lock nor 915 * At this point, the page may be truncated or
918 * lock on the page itself: the page may be truncated or 916 * invalidated (changing page->mapping to NULL), or
919 * invalidated (changing page->mapping to NULL), or even 917 * even swizzled back from swapper_space to tmpfs file
920 * swizzled back from swapper_space to tmpfs file 918 * mapping. However, page->index will not change
921 * mapping 919 * because we have a reference on the page.
922 */ 920 */
921 if (page->index > end) {
922 /*
923 * can't be range_cyclic (1st pass) because
924 * end == -1 in that case.
925 */
926 done = 1;
927 break;
928 }
929
930 done_index = page->index + 1;
931
923 lock_page(page); 932 lock_page(page);
924 933
925 /* 934 /*
@@ -936,15 +945,6 @@ continue_unlock:
936 continue; 945 continue;
937 } 946 }
938 947
939 if (page->index > end) {
940 /*
941 * can't be range_cyclic (1st pass) because
942 * end == -1 in that case.
943 */
944 done = 1;
945 goto continue_unlock;
946 }
947
948 if (!PageDirty(page)) { 948 if (!PageDirty(page)) {
949 /* someone wrote it for us */ 949 /* someone wrote it for us */
950 goto continue_unlock; 950 goto continue_unlock;