diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2016-03-08 01:56:22 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-04-28 10:41:47 +0200 |
commit | 894b36e35ae01186b77b083f3f67569a349062a6 (patch) | |
tree | bbd83cc8e4060aa0d20775924f1fbb07d427072e /fs/btrfs/extent_io.c | |
parent | Btrfs: make mapping->writeback_index point to the last written page (diff) | |
download | linux-894b36e35ae01186b77b083f3f67569a349062a6.tar.xz linux-894b36e35ae01186b77b083f3f67569a349062a6.zip |
Btrfs: cleanup error handling in extent_write_cached_pages
Now that we bail out immediately if ->writepage() returns an error,
we don't need an extra error to retain the error code.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fd41a730d239..b67d6d24440b 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3916,7 +3916,6 @@ static int extent_write_cache_pages(struct extent_io_tree *tree, struct inode *inode = mapping->host; int ret = 0; int done = 0; - int err = 0; int nr_to_write_done = 0; struct pagevec pvec; int nr_pages; @@ -4009,8 +4008,6 @@ retry: unlock_page(page); ret = 0; } - if (!err && ret < 0) - err = ret; if (ret < 0) { /* * done_index is set past this page, @@ -4036,7 +4033,7 @@ retry: pagevec_release(&pvec); cond_resched(); } - if (!scanned && !done && !err) { + if (!scanned && !done) { /* * We hit the last page and there is more work to be done: wrap * back to the start of the file @@ -4050,7 +4047,7 @@ retry: mapping->writeback_index = done_index; btrfs_add_delayed_iput(inode); - return err; + return ret; } static void flush_epd_write_bio(struct extent_page_data *epd) |