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.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index b493db7841dc..dc32dae01e5f 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1051,13 +1051,22 @@ continue_unlock:
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 if (wbc->sync_mode == WB_SYNC_NONE) { 1054 if (nr_to_write > 0)
1055 wbc->nr_to_write--; 1055 nr_to_write--;
1056 if (wbc->nr_to_write <= 0) { 1056 else if (wbc->sync_mode == WB_SYNC_NONE) {
1057 done = 1; 1057 /*
1058 break; 1058 * We stop writing back only if we are not
1059 } 1059 * doing integrity sync. In case of integrity
1060 * sync we have to keep going because someone
1061 * may be concurrently dirtying pages, and we
1062 * might have synced a lot of newly appeared
1063 * dirty pages, but have not synced all of the
1064 * old dirty pages.
1065 */
1066 done = 1;
1067 break;
1060 } 1068 }
1069
1061 if (wbc->nonblocking && bdi_write_congested(bdi)) { 1070 if (wbc->nonblocking && bdi_write_congested(bdi)) {
1062 wbc->encountered_congestion = 1; 1071 wbc->encountered_congestion = 1;
1063 done = 1; 1072 done = 1;