diff options
-rw-r--r-- | mm/filemap.c | 2 | ||||
-rw-r--r-- | mm/page-writeback.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index f9d88183f697..9c5e6235cc74 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -210,7 +210,7 @@ int __filemap_fdatawrite_range(struct address_space *mapping, loff_t start, | |||
210 | int ret; | 210 | int ret; |
211 | struct writeback_control wbc = { | 211 | struct writeback_control wbc = { |
212 | .sync_mode = sync_mode, | 212 | .sync_mode = sync_mode, |
213 | .nr_to_write = mapping->nrpages * 2, | 213 | .nr_to_write = LONG_MAX, |
214 | .range_start = start, | 214 | .range_start = start, |
215 | .range_end = end, | 215 | .range_end = end, |
216 | }; | 216 | }; |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 2e847cdcad0e..5edca676e2c3 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -963,8 +963,10 @@ retry: | |||
963 | } | 963 | } |
964 | } | 964 | } |
965 | 965 | ||
966 | if (--nr_to_write <= 0) | 966 | if (wbc->sync_mode == WB_SYNC_NONE) { |
967 | done = 1; | 967 | if (--wbc->nr_to_write <= 0) |
968 | done = 1; | ||
969 | } | ||
968 | if (wbc->nonblocking && bdi_write_congested(bdi)) { | 970 | if (wbc->nonblocking && bdi_write_congested(bdi)) { |
969 | wbc->encountered_congestion = 1; | 971 | wbc->encountered_congestion = 1; |
970 | done = 1; | 972 | done = 1; |