Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp889155pxb; Wed, 3 Mar 2021 19:51:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWfzzi1bixCovFPUVzXwF2iTycc+/vlsxLEbALzf+TMF3z6kkX3TBVWh0RbyDkmGUhOmLP X-Received: by 2002:aa7:c3c1:: with SMTP id l1mr2305120edr.208.1614829886985; Wed, 03 Mar 2021 19:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614829886; cv=none; d=google.com; s=arc-20160816; b=L/AoW2Yt2TfCiYQo8VDGlXWgkxM8JC0ClWFInXHEDndKKkyZYwAdAe/a9fmqUSLr3n gNl4Pn3NuNlfNy6p2RLZwF9F6xXwyo1ufpauvGz3n/xfOr3cI5v4Jd/mJKdti4yyZnzh 8f7QvqmwyPPEVBIHUkEXsYjlTmH2Ea8XNeQqcgwqLnj25umKL4NvItGnU3w06SzssEBa rIVvtYqQXMPVkH5f8W//hEiCb3c0ER1Q4SWSZkScutkRXOwTThoeLuN5VgSHCVD7iJZe zrmrREq2OsA7MzkQCGwrJmiivYoSGWcAXPkqvBdAn9Luv/jt0MGgXIHW+1E56QTtUoGA bM1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fA1umBtM6/SqIAG2FH7IqWTjj453UXlo3FpP6EQLu7I=; b=BnRAhy4tCzjrMiY6tfVCw7HF1Ko/EjCg+JcoW4H08WIMurNZGssfZiw4kHvtR8aZfA +/OqSG8j6f1xRI+YUsnhIMDZhozynTAbwLkSQ2m3N3KJJ5rRnRb8dwEExKv7rrj3/oDd p74Y2qNGufQDTgsmvI/llPFvJNdbJQJ5+s6IRqeaUSDtBdVPUAorXvhBSF6Z5pJPDKrZ bUtnmrlDyVtKiH6kKDMwW8MZlNCI/7fngf40HMQPWeOafqrBmWHM8iYEcaB5Ra20wSpV dP8pho/FRs4wmyZN9x6GTMqIOSgDiygzB9plcLAin/uNgXfhZKXikh2dKtv4rXAkQUYT ZRwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jJdfVMvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si6780455edv.12.2021.03.03.19.51.04; Wed, 03 Mar 2021 19:51:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jJdfVMvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380279AbhCBBuC (ORCPT + 99 others); Mon, 1 Mar 2021 20:50:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:47282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241569AbhCAT1B (ORCPT ); Mon, 1 Mar 2021 14:27:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 873E065246; Mon, 1 Mar 2021 17:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619651; bh=6DKp67QIqSgKPfbHQxhowL4lKik5+/5ti4Hr7GpcmJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJdfVMvnyveplwWJIxHGNYh7XfqSiua1vT6L4CX3qnVZ3XuakXnJmAOAzH64P8XSb 4KX4rBjSG0QXxgwSVSUMS9HUskfcxUCxG9Qrg3BYfC0nPxi8tTP5AQSecHji6ji5v7 FE5gSHKjNA5irKpHK8gUDp3hm7rzT4j5FC27z2xw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zygo Blaxell , Josef Bacik , David Sterba Subject: [PATCH 5.10 532/663] btrfs: do not warn if we cant find the reloc root when looking up backref Date: Mon, 1 Mar 2021 17:13:00 +0100 Message-Id: <20210301161208.172565061@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit f78743fbdae1bb31bc9c9233c3590a5048782381 upstream. The backref code is looking for a reloc_root that corresponds to the given fs root. However any number of things could have gone wrong while initializing that reloc_root, like ENOMEM while trying to allocate the root itself, or EIO while trying to write the root item. This would result in no corresponding reloc_root being in the reloc root cache, and thus would return NULL when we do the find_reloc_root() call. Because of this we do not want to WARN_ON(). This presumably was meant to catch developer errors, cases where we messed up adding the reloc root. However we can easily hit this case with error injection, and thus should not do a WARN_ON(). CC: stable@vger.kernel.org # 5.10+ Reported-by: Zygo Blaxell Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -2624,7 +2624,7 @@ static int handle_direct_tree_backref(st /* Only reloc backref cache cares about a specific root */ if (cache->is_reloc) { root = find_reloc_root(cache->fs_info, cur->bytenr); - if (WARN_ON(!root)) + if (!root) return -ENOENT; cur->root = root; } else {