|
@@ -1051,13 +1051,22 @@ continue_unlock:
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (wbc->sync_mode == WB_SYNC_NONE) {
|
|
|
|
- wbc->nr_to_write--;
|
|
|
|
- if (wbc->nr_to_write <= 0) {
|
|
|
|
- done = 1;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ if (nr_to_write > 0)
|
|
|
|
+ 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->nonblocking && bdi_write_congested(bdi)) {
|
|
if (wbc->nonblocking && bdi_write_congested(bdi)) {
|
|
wbc->encountered_congestion = 1;
|
|
wbc->encountered_congestion = 1;
|
|
done = 1;
|
|
done = 1;
|