From patchwork Tue Apr 19 12:17:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 717971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JCSpUg027615 for ; Tue, 19 Apr 2011 12:28:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659Ab1DSM2s (ORCPT ); Tue, 19 Apr 2011 08:28:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22930 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028Ab1DSM2s (ORCPT ); Tue, 19 Apr 2011 08:28:48 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3JCSmci013118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Apr 2011 08:28:48 -0400 Received: from test1244.test.redhat.com (test1244.test.redhat.com [10.10.10.244]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3JCSlHD010680 for ; Tue, 19 Apr 2011 08:28:47 -0400 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: put the right bio if we have an error Date: Tue, 19 Apr 2011 08:17:48 -0400 Message-Id: <1303215468-12864-1-git-send-email-josef@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 12:28:51 +0000 (UTC) In btrfs_submit_direct_hook if the first btrfs_map_block fails we need to put the orig_bio, not bio. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7624e6c..3217919 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6043,7 +6043,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, ret = btrfs_map_block(map_tree, READ, start_sector << 9, &map_length, NULL, 0); if (ret) { - bio_put(bio); + bio_put(orig_bio); return -EIO; }