Commit f5e596bb authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nathan Scott

[XFS] fix writeback control handling fix a reversed condition on where to

trylock and deal with block layer congestion properly.	Patch from David
Chinner and Christoph Hellwig.

SGI-PV: 947118
SGI-Modid: xfs-linux-melb:xfs-kern:203830a
Signed-off-by: default avatarChristoph Hellwig <hch@sgi.com>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 6c4fe19f
...@@ -722,8 +722,17 @@ xfs_convert_page( ...@@ -722,8 +722,17 @@ xfs_convert_page(
SetPageUptodate(page); SetPageUptodate(page);
if (startio) { if (startio) {
if (count) if (count) {
wbc->nr_to_write--; struct backing_dev_info *bdi;
bdi = inode->i_mapping->backing_dev_info;
if (bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1;
done = 1;
} else if (--wbc->nr_to_write <= 0) {
done = 1;
}
}
xfs_start_page_writeback(page, wbc, !page_dirty, count); xfs_start_page_writeback(page, wbc, !page_dirty, count);
} }
...@@ -812,7 +821,7 @@ xfs_page_state_convert( ...@@ -812,7 +821,7 @@ xfs_page_state_convert(
int all_bh = unmapped; int all_bh = unmapped;
/* wait for other IO threads? */ /* wait for other IO threads? */
if (startio && wbc->sync_mode != WB_SYNC_NONE) if (startio && (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking))
trylock_flag |= BMAPI_TRYLOCK; trylock_flag |= BMAPI_TRYLOCK;
/* Is this page beyond the end of the file? */ /* Is this page beyond the end of the file? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment