Skip to content

Commit

Permalink
Btrfs: fix missing error handler if submiting re-read bio fails
Browse files Browse the repository at this point in the history
We forgot to free failure record and bio after submitting re-read bio failed,
fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Miao Xie authored and Chris Mason committed Sep 17, 2014
1 parent c1dc089 commit 6c387ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,11 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
ret = tree->ops->submit_bio_hook(inode, read_mode, bio,
failrec->this_mirror,
failrec->bio_flags, 0);
if (ret) {
free_io_failure(inode, failrec, 0);
bio_put(bio);
}

return ret;
}

Expand Down

0 comments on commit 6c387ab

Please sign in to comment.