diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-06-18 10:46:31 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-18 10:46:35 +0200 |
commit | 4cb6948e5365ab874bb71ac35fb6b7c6dd305765 (patch) | |
tree | 0af0f44cce9043f3d66b7259536c6c99b790d9b0 /mm | |
parent | 89275d59b572b92b1e2f6ddb63c49deecb801ff9 (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) | |
download | kernel_replicant_linux-4cb6948e5365ab874bb71ac35fb6b7c6dd305765.tar.gz kernel_replicant_linux-4cb6948e5365ab874bb71ac35fb6b7c6dd305765.tar.bz2 kernel_replicant_linux-4cb6948e5365ab874bb71ac35fb6b7c6dd305765.zip |
Merge commit 'v2.6.35-rc3' into sched/core
Merge reason: Update to the latest -rc.
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page-writeback.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 5fa63bdf52e4..bbd396ac9546 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -835,7 +835,6 @@ int write_cache_pages(struct address_space *mapping, pgoff_t done_index; int cycled; int range_whole = 0; - long nr_to_write = wbc->nr_to_write; pagevec_init(&pvec, 0); if (wbc->range_cyclic) { @@ -852,7 +851,22 @@ int write_cache_pages(struct address_space *mapping, if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) range_whole = 1; cycled = 1; /* ignore range_cyclic tests */ + + /* + * If this is a data integrity sync, cap the writeback to the + * current end of file. Any extension to the file that occurs + * after this is a new write and we don't need to write those + * pages out to fulfil our data integrity requirements. If we + * try to write them out, we can get stuck in this scan until + * the concurrent writer stops adding dirty pages and extending + * EOF. + */ + if (wbc->sync_mode == WB_SYNC_ALL && + wbc->range_end == LLONG_MAX) { + end = i_size_read(mapping->host) >> PAGE_CACHE_SHIFT; + } } + retry: done_index = index; while (!done && (index <= end)) { @@ -935,11 +949,10 @@ continue_unlock: done = 1; break; } - } + } - if (nr_to_write > 0) { - nr_to_write--; - if (nr_to_write == 0 && + if (wbc->nr_to_write > 0) { + if (--wbc->nr_to_write == 0 && wbc->sync_mode == WB_SYNC_NONE) { /* * We stop writing back only if we are @@ -970,11 +983,8 @@ continue_unlock: end = writeback_index - 1; goto retry; } - if (!wbc->no_nrwrite_index_update) { - if (wbc->range_cyclic || (range_whole && nr_to_write > 0)) - mapping->writeback_index = done_index; - wbc->nr_to_write = nr_to_write; - } + if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) + mapping->writeback_index = done_index; return ret; } |