Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17940275ybl; Thu, 2 Jan 2020 15:13:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyfPJIYde9VpOZDqb1N2oAMCwkyBuUNy0MNssxp4hCtEvNobAn65qqSd5hRgTpDf7ELxQpb X-Received: by 2002:a9d:784b:: with SMTP id c11mr89722721otm.246.1578006795241; Thu, 02 Jan 2020 15:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578006795; cv=none; d=google.com; s=arc-20160816; b=KzFh8L7brB5zMJgWrqk9oz/1lQr7g82hkdooRsPKtNQTXW5/7qbFi7vDRRo+FfL3Np F45gOkp9tXuvGNd/vuyCgex6GNLGAPDmClFzHJ9NNbXdw5dVRl65708BGyoopeVISL/2 7SHNX+arBtgWL/vT8TdvLr3ZTq66UYBtrL3ec93/rKtEyyR99nQiJ+ZAotYvxiJeqX7F iloo1QeA3pStNbOxH57F2yUoM+nBuNEWnT8NG+ynhJUm0bTx0EeBLG2X/c0F8p5CeFs6 5Fi9P0UldYO7S9gmFM2o54RqhyZ0OzGGUBJS6moJ+TrhP6fuAWSVp5h1Uel1zJlNo3lf w6pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g+BQvA88BjerTq7Ww6RWQ4bXccRblePAWou9Vs5eFnc=; b=nmBudXs/HZRkm6ZX12v2Es8mwRac1CsNLfTOAYfAOvSM69+1WNG07e97P76vkoR201 GANTfkuVLXC81m4SsQTRcUcC+1qQ1PAQnr0iyw3K2ae7bNXT8uBrlcMLa3UVetbBdo49 so4m43FoscmbTHxKlbhr+uOnwdh6vEltJDL7qe3D/zRno7hj5AOYW4Z58JPMGxiU06fG zAk6gnM4asr7Q99hloZ7W0MtJr/kysSSua5fxR8v43NANBtmKRCIQ34O6e6ssA/DfYjR Ir9oEdp0shmygOI4DGYSHOWt/qAMUnuXdRAohhzlb9sKKTGSomU8s83IYCpeaEEM0RnS Inkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="iz4/z29A"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si30089297otq.21.2020.01.02.15.13.03; Thu, 02 Jan 2020 15:13:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="iz4/z29A"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729487AbgABWnh (ORCPT + 99 others); Thu, 2 Jan 2020 17:43:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:43092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730559AbgABWe2 (ORCPT ); Thu, 2 Jan 2020 17:34:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E267A20866; Thu, 2 Jan 2020 22:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004468; bh=POlYgQfhkJv2yEf8YsXysIuUDdLsDpL3K68G9T0j/Ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iz4/z29AgB7zU3eLBC59uv/+K4K8hxgVueJ2VX9hIgYBD+Y8tVj0iq6c0nMJALwqJ /WzgwupAIaSW1roC5DpXuXYfbQ3/VFhneTmABNDZkuKDCc4+B6B1MWt5En75cFXvh5 hpNBPz7SsWbdcC223wG4NXLuZKvrbqJHzb37XnV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Filipe Manana , Johannes Thumshirn , Josef Bacik , David Sterba Subject: [PATCH 4.4 002/137] btrfs: handle ENOENT in btrfs_uuid_tree_iterate Date: Thu, 2 Jan 2020 23:06:15 +0100 Message-Id: <20200102220546.931969543@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit 714cd3e8cba6841220dce9063a7388a81de03825 upstream. If we get an -ENOENT back from btrfs_uuid_iter_rem when iterating the uuid tree we'll just continue and do btrfs_next_item(). However we've done a btrfs_release_path() at this point and no longer have a valid path. So increment the key and go back and do a normal search. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Filipe Manana Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/uuid-tree.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/btrfs/uuid-tree.c +++ b/fs/btrfs/uuid-tree.c @@ -332,6 +332,8 @@ again_search_slot: } if (ret < 0 && ret != -ENOENT) goto out; + key.offset++; + goto again_search_slot; } item_size -= sizeof(subid_le); offset += sizeof(subid_le);