From patchwork Wed Mar 16 18:01:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 639501 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 p2GICJdE023464 for ; Wed, 16 Mar 2011 18:12:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752927Ab1CPSMQ (ORCPT ); Wed, 16 Mar 2011 14:12:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200Ab1CPSMQ (ORCPT ); Wed, 16 Mar 2011 14:12:16 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2GICGLF010037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 16 Mar 2011 14:12:16 -0400 Received: from test1244.test.redhat.com (test1244.test.redhat.com [10.10.10.244]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2GICFjq016886 for ; Wed, 16 Mar 2011 14:12:15 -0400 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: check return value of btrfs_search_slot properly Date: Wed, 16 Mar 2011 14:01:27 -0400 Message-Id: <1300298487-5638-1-git-send-email-josef@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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]); Wed, 16 Mar 2011 18:12:19 +0000 (UTC) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 3786eca..a85b044 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -608,6 +608,8 @@ again: key.offset = split; ret = btrfs_search_slot(trans, root, &key, path, -1, 1); + if (ret < 0) + goto out; if (ret > 0 && path->slots[0] > 0) path->slots[0]--;