From patchwork Mon Jan 24 21:43:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 503041 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 p0OLrqVt000835 for ; Mon, 24 Jan 2011 21:53:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413Ab1AXVxu (ORCPT ); Mon, 24 Jan 2011 16:53:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37236 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892Ab1AXVxr (ORCPT ); Mon, 24 Jan 2011 16:53:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0OLrkHF029907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Jan 2011 16:53:46 -0500 Received: from localhost.localdomain (test1244.test.redhat.com [10.10.10.244]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0OLrjFi012292 for ; Mon, 24 Jan 2011 16:53:46 -0500 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/3] Btrfs: fix check_path_shared so it returns the right value Date: Mon, 24 Jan 2011 16:43:18 -0500 Message-Id: <1295905400-1417-2-git-send-email-josef@redhat.com> In-Reply-To: <1295905400-1417-1-git-send-email-josef@redhat.com> References: <1295905400-1417-1-git-send-email-josef@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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]); Mon, 24 Jan 2011 21:53:53 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 160b55b..e353da5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2714,9 +2714,10 @@ static int check_path_shared(struct btrfs_root *root, struct extent_buffer *eb; int level; u64 refs = 1; - int uninitialized_var(ret); for (level = 0; level < BTRFS_MAX_LEVEL; level++) { + int ret; + if (!path->nodes[level]) break; eb = path->nodes[level]; @@ -2727,7 +2728,7 @@ static int check_path_shared(struct btrfs_root *root, if (refs > 1) return 1; } - return ret; /* XXX callers? */ + return 0; } /*