summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 99c24b1ec7cc..3ca18f0bdce6 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -875,6 +875,7 @@ int write_cache_pages(struct address_space *mapping,
pgoff_t uninitialized_var(writeback_index);
pgoff_t index;
pgoff_t end; /* Inclusive */
+ pgoff_t done_index;
int cycled;
int range_whole = 0;
@@ -900,6 +901,7 @@ int write_cache_pages(struct address_space *mapping,
cycled = 1; /* ignore range_cyclic tests */
}
retry:
+ done_index = index;
while (!done && (index <= end) &&
(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
@@ -909,6 +911,8 @@ retry:
for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i];
+ done_index = page->index + 1;
+
/*
* At this point we hold neither mapping->tree_lock nor
* lock on the page itself: the page may be truncated or
@@ -970,7 +974,7 @@ retry:
goto retry;
}
if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
- mapping->writeback_index = index;
+ mapping->writeback_index = done_index;
if (wbc->range_cont)
wbc->range_start = index << PAGE_CACHE_SHIFT;