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 5FC95C636D7 for ; Sat, 18 Feb 2023 04:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbjBRElW (ORCPT ); Fri, 17 Feb 2023 23:41:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBRElR (ORCPT ); Fri, 17 Feb 2023 23:41:17 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA7A2CFD1; Fri, 17 Feb 2023 20:41:15 -0800 (PST) Received: from [0.0.0.0] ([149.28.201.231]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MRCK6-1p8Fhx2he8-00NDPp; Sat, 18 Feb 2023 05:41:10 +0100 Message-ID: Date: Sat, 18 Feb 2023 12:41:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH] btrfs: handle btrfs_del_item errors in __btrfs_update_delayed_inode Content-Language: en-US To: void0red , dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230218043649.86-1-void0red@gmail.com> From: Qu Wenruo In-Reply-To: <20230218043649.86-1-void0red@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:OezVmRDCIJV/ih4wvar2tMobYhqoFTqambXjN4zNx78S7xipyEN ZEKE4Hxdan6m/O2q1k0pQ6sVbxrke7aff9KGHpwkrGL3hPCU7H18RDPL3zealVYfSgeCm0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9AzqOYvLL1ReZBHBYB6MpEtgWpQulnc0i78XZz jyz7ZpHd6RWbO5mE9+VgoP4D6gM= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/2/18 12:36, void0red wrote: > Even if the slot is already read out, we may still need to re-balance > the tree, thus it can cause error in that btrfs_del_item() call. > > Link: https://lore.kernel.org/linux-btrfs/9b45f60f-c849-e072-64ef-298937e6a8a3@suse.com/T/#t > > Signed-off-by: void0red Reviewed-by: Qu Wenruo Thanks, Qu > --- > fs/btrfs/delayed-inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c > index cac5169eaf8d..88a5d893972d 100644 > --- a/fs/btrfs/delayed-inode.c > +++ b/fs/btrfs/delayed-inode.c > @@ -1043,7 +1043,7 @@ static int __btrfs_update_delayed_inode(struct btrfs_trans_handle *trans, > * so there is only one iref. The case that several irefs are > * in the same item doesn't exist. > */ > - btrfs_del_item(trans, root, path); > + ret = btrfs_del_item(trans, root, path); > out: > btrfs_release_delayed_iref(node); > btrfs_release_path(path);