Skip to content
  • Eric Sandeen's avatar
    ext4: update writeback_index based on last page scanned · 72f84e65
    Eric Sandeen authored
    
    
    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: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    72f84e65