]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix missing error handler if submiting re-read bio fails
authorMiao Xie <miaox@cn.fujitsu.com>
Fri, 12 Sep 2014 10:43:57 +0000 (18:43 +0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 3 Dec 2014 15:17:04 +0000 (10:17 -0500)
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>
(cherry picked from commit 6c387ab20db15f2bd448f7c508e2638101b16ea1)

fs/btrfs/extent_io.c

index 46194ab55ce1d5837c0cf502e6944bff06900912..c766958fb9ad1e173eb7f178012d627c14452497 100644 (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;
 }