diff options
Diffstat (limited to 'mm')
-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 f3033d0f5e5..0b382788790 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -209,7 +209,7 @@ int __filemap_fdatawrite_range(struct address_space *mapping, loff_t start, int ret; struct writeback_control wbc = { .sync_mode = sync_mode, - .nr_to_write = mapping->nrpages * 2, + .nr_to_write = LONG_MAX, .range_start = start, .range_end = end, }; diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ac3db798d6a..362640c3228 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -967,8 +967,10 @@ retry: } } - if (--(wbc->nr_to_write) <= 0) - done = 1; + if (wbc->sync_mode == WB_SYNC_NONE) { + if (--wbc->nr_to_write <= 0) + done = 1; + } if (wbc->nonblocking && bdi_write_congested(bdi)) { wbc->encountered_congestion = 1; done = 1; |