diff options
author | Richard Kennedy <richard@rsk.demon.co.uk> | 2009-12-25 15:46:07 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-12-25 15:46:07 -0500 |
commit | 2faf2e19dd0e060eeb32442858ef495ac3083277 (patch) | |
tree | cd8c28414036f2d8ad45663371e1544d4efad5d4 /fs/ext4/inode.c | |
parent | 6d3b82f2d31f22085e5711b28dddcb9fb3d97a25 (diff) |
ext4: return correct wbc.nr_to_write in ext4_da_writepages
When ext4_da_writepages increases the nr_to_write in writeback_control
then it must always re-base the return value. Originally there was a
(misguided) attempt prevent wbc.nr_to_write from going negative. In
fact, it's necessary to allow nr_to_write to be negative so that
wb_writeback() can correctly calculate how many pages were actually
written.
Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 282621f18c10..3e3b45458ef8 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2967,8 +2967,7 @@ retry: | |||
2967 | out_writepages: | 2967 | out_writepages: |
2968 | if (!no_nrwrite_index_update) | 2968 | if (!no_nrwrite_index_update) |
2969 | wbc->no_nrwrite_index_update = 0; | 2969 | wbc->no_nrwrite_index_update = 0; |
2970 | if (wbc->nr_to_write > nr_to_writebump) | 2970 | wbc->nr_to_write -= nr_to_writebump; |
2971 | wbc->nr_to_write -= nr_to_writebump; | ||
2972 | wbc->range_start = range_start; | 2971 | wbc->range_start = range_start; |
2973 | trace_ext4_da_writepages_result(inode, wbc, ret, pages_written); | 2972 | trace_ext4_da_writepages_result(inode, wbc, ret, pages_written); |
2974 | return ret; | 2973 | return ret; |