Commit 94d9e11b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Sterba

btrfs: do not return errors from btrfs_submit_metadata_bio

btrfs_submit_metadata_bio already calls ->bi_end_io on error and the
caller must ignore the return value, so remove it.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@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 abf48d58
...@@ -920,8 +920,7 @@ static bool should_async_write(struct btrfs_fs_info *fs_info, ...@@ -920,8 +920,7 @@ static bool should_async_write(struct btrfs_fs_info *fs_info,
return true; return true;
} }
blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_num)
int mirror_num)
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
blk_status_t ret; blk_status_t ret;
...@@ -933,13 +932,11 @@ blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, ...@@ -933,13 +932,11 @@ blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio,
*/ */
ret = btrfs_bio_wq_end_io(fs_info, bio, ret = btrfs_bio_wq_end_io(fs_info, bio,
BTRFS_WQ_ENDIO_METADATA); BTRFS_WQ_ENDIO_METADATA);
if (ret) if (!ret)
goto out_w_error;
ret = btrfs_map_bio(fs_info, bio, mirror_num); ret = btrfs_map_bio(fs_info, bio, mirror_num);
} else if (!should_async_write(fs_info, BTRFS_I(inode))) { } else if (!should_async_write(fs_info, BTRFS_I(inode))) {
ret = btree_csum_one_bio(bio); ret = btree_csum_one_bio(bio);
if (ret) if (!ret)
goto out_w_error;
ret = btrfs_map_bio(fs_info, bio, mirror_num); ret = btrfs_map_bio(fs_info, bio, mirror_num);
} else { } else {
/* /*
...@@ -950,14 +947,10 @@ blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, ...@@ -950,14 +947,10 @@ blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio,
0, btree_submit_bio_start); 0, btree_submit_bio_start);
} }
if (ret) if (ret) {
goto out_w_error;
return 0;
out_w_error:
bio->bi_status = ret; bio->bi_status = ret;
bio_endio(bio); bio_endio(bio);
return ret; }
} }
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
......
...@@ -87,8 +87,7 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info, ...@@ -87,8 +87,7 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio, int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio,
struct page *page, u64 start, u64 end, struct page *page, u64 start, u64 end,
int mirror); int mirror);
blk_status_t btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_num);
int mirror_num);
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info); struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info);
#endif #endif
......
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