From patchwork Fri Sep 8 17:20:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13377738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA75BEEB562 for ; Fri, 8 Sep 2023 17:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245416AbjIHRVC (ORCPT ); Fri, 8 Sep 2023 13:21:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233161AbjIHRVA (ORCPT ); Fri, 8 Sep 2023 13:21:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B820199F for ; Fri, 8 Sep 2023 10:20:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89B76C433C8 for ; Fri, 8 Sep 2023 17:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694193657; bh=g6XNS7/EsJySe6oWOGbizXbEj0VN2mldNvkXEtl2OkE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CuQpK9PalqOoYOQiPalfP6L/mG86BbiLg8kmyM+rHGMb0T6in6YtbxqWgNJ/sCj1j uD5qpY6qnn3JMC9Vx8NqX2R2p0Ge7Z/Idvl2aTNkZh8/1urwby8udR2kP3AOZHeF/9 sXMtmz87V6Aoqd17F2BRc12a5/bnkzCjIDJJccjh7L8KTrOth9sgAuEV15B8fEvYX4 UzPU4kaQwPm9Qinv5axELFaZ2smmdlvXA50+eC8Yahekm5uR1ngkrydb3P6XAGhJ5k 6booLxdiSeY/y2skDrrNHT+43xx3ClvF5qWwTLL7cHTsC+vp3lBCgwkaLmnqj/H5/I xo2KaX57u4eJg== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 15/21] btrfs: return -EUCLEAN if extent item is missing when searching inline backref Date: Fri, 8 Sep 2023 18:20:32 +0100 Message-Id: <20d52d8e4ff00c2f64907e83bc379669cc20bb8b.1694192469.git.fdmanana@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Filipe Manana At lookup_inline_extent_backref() when trying to insert an inline backref, if we don't find the extent item we log an error and then return -EIO. This error code is confusing because there was actually no IO error, and this means we have some corruption, either caused by a bug or something like a memory bitflip for example. So change the error code from -EIO to -EUCLEAN. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index e57061106860..756589195ed7 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -851,7 +851,7 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans, "extent item not found for insert, bytenr %llu num_bytes %llu parent %llu root_objectid %llu owner %llu offset %llu", bytenr, num_bytes, parent, root_objectid, owner, offset); - ret = -EIO; + ret = -EUCLEAN; goto out; }