From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cn.fujitsu.com ([59.151.112.132]:43967 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1759135AbaGCKUt (ORCPT ); Thu, 3 Jul 2014 06:20:49 -0400 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s63AKkZJ013556 for ; Thu, 3 Jul 2014 18:20:46 +0800 From: Miao Xie To: Subject: [PATCH RESEND 5/9] Btrfs: fix missing error handler if submiting re-read bio fails Date: Thu, 3 Jul 2014 18:22:09 +0800 Message-ID: <1404382933-26672-5-git-send-email-miaox@cn.fujitsu.com> In-Reply-To: <1404382933-26672-1-git-send-email-miaox@cn.fujitsu.com> References: <1404382933-26672-1-git-send-email-miaox@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-btrfs-owner@vger.kernel.org List-ID: We forgot to free failure record and bio after submitting re-read bio failed, fix it. Signed-off-by: Miao Xie --- fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 23398ad..3a64354 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2345,6 +2345,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; } -- 1.9.3