diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index cb598eb4f3bd1ce7854cd24c0a755592cb15590b..88fc5a0c573f753625ed6e0abd1023197df83464 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3956,7 +3956,7 @@ static int extent_write_cache_pages(struct address_space *mapping, for (i = 0; i < nr_pages; i++) { struct page *page = pvec.pages[i]; - done_index = page->index; + done_index = page->index + 1; /* * At this point we hold neither the i_pages lock nor * the page lock: the page may be truncated or @@ -3993,16 +3993,6 @@ static int extent_write_cache_pages(struct address_space *mapping, ret = 0; } if (ret < 0) { - /* - * done_index is set past this page, - * so media errors will not choke - * background writeout for the entire - * file. This has consequences for - * range_cyclic semantics (ie. it may - * not be suitable for data integrity - * writeout). - */ - done_index = page->index + 1; done = 1; break; }