Commit cb4411dd authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Sterba

btrfs: do not return errors from btrfs_submit_compressed_read

btrfs_submit_compressed_read already calls ->bi_end_io on error and
the caller must ignore the return value, so remove it.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 94d9e11b
...@@ -801,7 +801,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, ...@@ -801,7 +801,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
* After the compressed pages are read, we copy the bytes into the * After the compressed pages are read, we copy the bytes into the
* bio we were passed and then call the bio end_io calls * bio we were passed and then call the bio end_io calls
*/ */
blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
int mirror_num, unsigned long bio_flags) int mirror_num, unsigned long bio_flags)
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
...@@ -947,7 +947,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, ...@@ -947,7 +947,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
comp_bio = NULL; comp_bio = NULL;
} }
} }
return BLK_STS_OK; return;
fail: fail:
if (cb->compressed_pages) { if (cb->compressed_pages) {
...@@ -963,7 +963,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, ...@@ -963,7 +963,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
free_extent_map(em); free_extent_map(em);
bio->bi_status = ret; bio->bi_status = ret;
bio_endio(bio); bio_endio(bio);
return ret; return;
finish_cb: finish_cb:
if (comp_bio) { if (comp_bio) {
comp_bio->bi_status = ret; comp_bio->bi_status = ret;
...@@ -971,7 +971,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, ...@@ -971,7 +971,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
} }
/* All bytes of @cb is submitted, endio will free @cb */ /* All bytes of @cb is submitted, endio will free @cb */
if (cur_disk_byte == disk_bytenr + compressed_len) if (cur_disk_byte == disk_bytenr + compressed_len)
return ret; return;
wait_var_event(cb, refcount_read(&cb->pending_sectors) == wait_var_event(cb, refcount_read(&cb->pending_sectors) ==
(disk_bytenr + compressed_len - cur_disk_byte) >> (disk_bytenr + compressed_len - cur_disk_byte) >>
...@@ -983,7 +983,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, ...@@ -983,7 +983,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
ASSERT(refcount_read(&cb->pending_sectors)); ASSERT(refcount_read(&cb->pending_sectors));
/* Now we are the only one referring @cb, can finish it safely. */ /* Now we are the only one referring @cb, can finish it safely. */
finish_compressed_bio_read(cb); finish_compressed_bio_read(cb);
return ret;
} }
/* /*
......
...@@ -102,7 +102,7 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start, ...@@ -102,7 +102,7 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
unsigned int write_flags, unsigned int write_flags,
struct cgroup_subsys_state *blkcg_css, struct cgroup_subsys_state *blkcg_css,
bool writeback); bool writeback);
blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
int mirror_num, unsigned long bio_flags); int mirror_num, unsigned long bio_flags);
unsigned int btrfs_compress_str2level(unsigned int type, const char *str); unsigned int btrfs_compress_str2level(unsigned int type, const char *str);
......
...@@ -2607,10 +2607,9 @@ blk_status_t btrfs_submit_data_bio(struct inode *inode, struct bio *bio, ...@@ -2607,10 +2607,9 @@ blk_status_t btrfs_submit_data_bio(struct inode *inode, struct bio *bio,
* the bio if there were any errors, so just return * the bio if there were any errors, so just return
* here. * here.
*/ */
ret = btrfs_submit_compressed_read(inode, bio, btrfs_submit_compressed_read(inode, bio, mirror_num,
mirror_num,
bio_flags); bio_flags);
goto out_no_endio; return BLK_STS_OK;
} else { } else {
/* /*
* Lookup bio sums does extra checks around whether we * Lookup bio sums does extra checks around whether we
...@@ -2644,7 +2643,6 @@ blk_status_t btrfs_submit_data_bio(struct inode *inode, struct bio *bio, ...@@ -2644,7 +2643,6 @@ blk_status_t btrfs_submit_data_bio(struct inode *inode, struct bio *bio,
bio->bi_status = ret; bio->bi_status = ret;
bio_endio(bio); bio_endio(bio);
} }
out_no_endio:
return ret; return ret;
} }
......
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