Skip to contentSkip to conversation

btrfs: btrfs_create_repair_bio never fails, skip error handling

PATCH In review David Sterba 2 participants 2 messages Jul 13, 2017 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: btrfs_create_repair_bio never fails, skip error handling

As it uses the non-failinig bio allocation, we can remove error handling from the callers as well.

---
 fs/btrfs/extent_io.c | 4 ----
 fs/btrfs/inode.c     | 4 ----
 2 files changed, 8 deletions(-)
fs/btrfs/extent_io.c +0 -4
index 2e6f69908303..7010b7764e23 100644
@@ -2394,10 +2394,6 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
 				      start - page_offset(page),
 				      (int)phy_offset, failed_bio->bi_end_io,
 				      NULL);
-	if (!bio) {
-		free_io_failure(failure_tree, tree, failrec);
-		return -EIO;
-	}
 	bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
 
 	btrfs_debug(btrfs_sb(inode->i_sb),
fs/btrfs/inode.c +0 -4
index 5d3c6ac960fd..97460e492d91 100644
@@ -8017,10 +8017,6 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
 	isector >>= inode->i_sb->s_blocksize_bits;
 	bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page,
 				pgoff, isector, repair_endio, repair_arg);
-	if (!bio) {
-		free_io_failure(failure_tree, io_tree, failrec);
-		return -EIO;
-	}
 	bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
 
 	btrfs_debug(BTRFS_I(inode)->root->fs_info,
Signature · 1 line
2.13.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · David Sterba

As it uses the non-failinig bio allocation, we can remove error handling from the callers as well.

Looks good.

-liubo

Quoted 43 lines
---
 fs/btrfs/extent_io.c | 4 ----
 fs/btrfs/inode.c     | 4 ----
 2 files changed, 8 deletions(-)
fs/btrfs/extent_io.c +0 -4
index 2e6f69908303..7010b7764e23 100644
@@ -2394,10 +2394,6 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
 				      start - page_offset(page),
 				      (int)phy_offset, failed_bio->bi_end_io,
 				      NULL);
-	if (!bio) {
-		free_io_failure(failure_tree, tree, failrec);
-		return -EIO;
-	}
 	bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
 
 	btrfs_debug(btrfs_sb(inode->i_sb),
fs/btrfs/inode.c +0 -4
index 5d3c6ac960fd..97460e492d91 100644
@@ -8017,10 +8017,6 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
 	isector >>= inode->i_sb->s_blocksize_bits;
 	bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page,
 				pgoff, isector, repair_endio, repair_arg);
-	if (!bio) {
-		free_io_failure(failure_tree, io_tree, failrec);
-		return -EIO;
-	}
 	bio_set_op_attrs(bio, REQ_OP_READ, read_mode);
 
 	btrfs_debug(BTRFS_I(inode)->root->fs_info,
Signature · 6 lines
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html