Btrfs: fix missing error handler if submiting re-read bio fails

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>
This commit is contained in:
Miao Xie 2014-09-12 18:43:57 +08:00 committed by Chris Mason
parent c1dc08967f
commit 6c387ab20d
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}