diff options
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 345b5f7abb7b..5f7cdc254e68 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -985,20 +985,23 @@ continue_unlock: } } - if (wbc->nr_to_write > 0) + if (wbc->nr_to_write > 0) { wbc->nr_to_write--; - else if (wbc->sync_mode == WB_SYNC_NONE) { - /* - * We stop writing back only if we are not - * doing integrity sync. In case of integrity - * sync we have to keep going because someone - * may be concurrently dirtying pages, and we - * might have synced a lot of newly appeared - * dirty pages, but have not synced all of the - * old dirty pages. - */ - done = 1; - break; + if (wbc->nr_to_write == 0 && + wbc->sync_mode == WB_SYNC_NONE) { + /* + * We stop writing back only if we are + * not doing integrity sync. In case of + * integrity sync we have to keep going + * because someone may be concurrently + * dirtying pages, and we might have + * synced a lot of newly appeared dirty + * pages, but have not synced all of the + * old dirty pages. + */ + done = 1; + break; + } } if (wbc->nonblocking && bdi_write_congested(bdi)) { |