diff options
author | David Sterba <dsterba@suse.com> | 2017-07-13 11:42:15 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-07-14 14:42:08 -0400 |
commit | e8f5b395d5332b5d720d62d33d6e06836392fd85 (patch) | |
tree | 9ca060a6839af0a92a6b28fe8f783d80d2ba7017 | |
parent | c09abff87f90c81d74b6483837a665f97448a475 (diff) |
btrfs: btrfs_create_repair_bio never fails, skip error handling
As the function uses the non-failing bio allocation, we can remove error
handling from the callers as well.
Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 4 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index a3122fba54e8..3a9ef02cad49 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2394,10 +2394,6 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset, | |||
2394 | start - page_offset(page), | 2394 | start - page_offset(page), |
2395 | (int)phy_offset, failed_bio->bi_end_io, | 2395 | (int)phy_offset, failed_bio->bi_end_io, |
2396 | NULL); | 2396 | NULL); |
2397 | if (!bio) { | ||
2398 | free_io_failure(failure_tree, tree, failrec); | ||
2399 | return -EIO; | ||
2400 | } | ||
2401 | bio_set_op_attrs(bio, REQ_OP_READ, read_mode); | 2397 | bio_set_op_attrs(bio, REQ_OP_READ, read_mode); |
2402 | 2398 | ||
2403 | btrfs_debug(btrfs_sb(inode->i_sb), | 2399 | btrfs_debug(btrfs_sb(inode->i_sb), |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 529437c337b4..eb495e956d53 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -8017,10 +8017,6 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio, | |||
8017 | isector >>= inode->i_sb->s_blocksize_bits; | 8017 | isector >>= inode->i_sb->s_blocksize_bits; |
8018 | bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page, | 8018 | bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page, |
8019 | pgoff, isector, repair_endio, repair_arg); | 8019 | pgoff, isector, repair_endio, repair_arg); |
8020 | if (!bio) { | ||
8021 | free_io_failure(failure_tree, io_tree, failrec); | ||
8022 | return -EIO; | ||
8023 | } | ||
8024 | bio_set_op_attrs(bio, REQ_OP_READ, read_mode); | 8020 | bio_set_op_attrs(bio, REQ_OP_READ, read_mode); |
8025 | 8021 | ||
8026 | btrfs_debug(BTRFS_I(inode)->root->fs_info, | 8022 | btrfs_debug(BTRFS_I(inode)->root->fs_info, |