Commit 894b36e3 authored by Liu Bo's avatar Liu Bo Committed by David Sterba

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: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a9132667
......@@ -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 @@ static int extent_write_cache_pages(struct extent_io_tree *tree,
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 @@ static int extent_write_cache_pages(struct extent_io_tree *tree,
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 @@ static int extent_write_cache_pages(struct extent_io_tree *tree,
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment