|
@@ -851,7 +851,22 @@ int write_cache_pages(struct address_space *mapping,
|
|
if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
|
|
if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
|
|
range_whole = 1;
|
|
range_whole = 1;
|
|
cycled = 1; /* ignore range_cyclic tests */
|
|
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:
|
|
retry:
|
|
done_index = index;
|
|
done_index = index;
|
|
while (!done && (index <= end)) {
|
|
while (!done && (index <= end)) {
|