ext4: update writeback_index based on last page scanned
commit72f84e6560d18d60a091df27edf81409be6641cb
authorEric Sandeen <sandeen@redhat.com>
Thu, 28 Oct 2010 01:30:13 +0000 (27 21:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:13 +0000 (27 21:30 -0400)
treee2fa11476b074f8526d620820f8b2e86e8a11412
parent5b41d92437f1ae19b3f3ffa3b16589fd5df50ac0
ext4: update writeback_index based on last page scanned

As pointed out in a prior patch, updating the mapping's
writeback_index based on pages written isn't quite right;
what the writeback index is really supposed to reflect is
the next page which should be scanned for writeback during
periodic flush.

As in write_cache_pages(), write_cache_pages_da() does
this scanning for us as we assemble the mpd for later
writeout.  If we keep track of the next page after the
current scan, we can easily update writeback_index without
worrying about pages written vs. pages skipped, etc.

Without this, an fsync will reset writeback_index to
0 (its starting index) + however many pages it wrote, which
can mess up the progress of periodic flush.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/inode.c