Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1767019lqa; Mon, 29 Apr 2024 20:31:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXj9miMvthQeRYUJfOleFOpp7YA0InsLSCEA916r9iyizXYvKkk9UokH1MHXNzLWW42PZc7EI647i3c2UJJBBXviVyS4GRj6o5tpWZww== X-Google-Smtp-Source: AGHT+IEX6s0qvIC7FNjWktaCSO6Me7Tt4A4JJ0AQTiyU5rayIz0di+MG6MqocMNUkQo3L8Bj3/Uf X-Received: by 2002:a05:6a00:2d02:b0:6f3:f062:c09b with SMTP id fa2-20020a056a002d0200b006f3f062c09bmr8467769pfb.6.1714447897422; Mon, 29 Apr 2024 20:31:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714447897; cv=pass; d=google.com; s=arc-20160816; b=Lx0wbqaho31ckeOFbNJQQCw3g1Z81xg83Zt7I8odq4R0aPhInVWxV9HevNKgAnviUB 7bvO1I0OosRU8OQVvfcOqK2EvjCPiHl6CH0+sXkBRC/V5mqDqvD5OaOb01P2d18pQJcI 0xo+hz4go2+NvdpVrrg0kDO4fnBlKi3WJ7tPZZKJxJYZ3kYUusoYlEVZ8OWxGf63lsRx V1/abz3qjEJ+RQ1Mbo9x43kSxR8hZzsnxvxdeg3eOOiPuoGYK2YL7WRkY7C9oBR+qi20 Ri8vPr6s8h98b+Ujh73Y+OGsA8l+s27TT40AgBimRUk5QmFtZTo8noh9gkyod2jQ5bMr pfVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=7fc1Lq3tEEPo9NZlxBYxSolqOF6sb91EQJr9xYbaujE=; fh=md2kVIsEU7q/zkmNauO0psAe7KGpSwAVgu0ObQLKXes=; b=VntyN+IKq2wPM4vVcmFX10sicnUhKUBmwx5GiZK1tJ9ILOAoJ3czQ7IzAvd4l2u0HH K+Xk7wPeaBOs3tnWXGeUjr6NjPCezxGAYaMDacbPrBBM9jCcBK4zXhMOp2dTicyfgJCD yJWgF/SytBsN9KtQr23p38K7dcnTB0vpFHAv0godEFGqSShtFtAVYElVzOpZt5Qxnhq6 Na9LSMOeGnQZgAy5iofucdvuXA1Jb2R1hc/4UvjJZvfU68yF9JGP1OhWxIjzlC7JXyHR 1VEALw+IdtPFjEWsWVwL7zxOlPRP6cZG+2D2Q1IEJqblDT2tHofL6Ul1tZNoQ5w3Jgp3 0F8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=V9mCmdjl; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-163296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h125-20020a625383000000b006eaa98ae6d7si10559190pfb.220.2024.04.29.20.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 20:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=V9mCmdjl; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-163296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 08E9F2834EC for ; Tue, 30 Apr 2024 03:31:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE7361118C; Tue, 30 Apr 2024 03:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="V9mCmdjl" Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C0710A0C for ; Tue, 30 Apr 2024 03:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447888; cv=none; b=Pn7CJGsdnDkpczJWluJsU5U5y+JiYtlR2zuAp8+8q7dDDsTBHgI2ChfVU24dw4lziok3tavNZ3p/4WbWfx4YBY8iwlU958FzJUxifvattKRsjyHG0n65+ZPSWCquF5sdYsY5PrDky96QjuTbm6vTUhdaqPSg93wFbrXnoMvok/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447888; c=relaxed/simple; bh=LMfpDW5w5x4oJd8+FDaMLuLBYtiAHznZIr+E0rtVK2I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BFsv+zb5HvW6db5Rpfhc4wuanKEmCPzvXsPQSz9lFJYk1ncUgflHWQ9PJDzMY6VjI1Z/Cx2YFxXO5YuX+6Lh4wJU66QAorwkpBAUe8Bs67V3Rti/+HlKmayragdoe4bWMBY1RJI6Zn8dp7ygbhzLt2Ya+C0YDc7+doKSIyrUMpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=V9mCmdjl; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 29 Apr 2024 23:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714447884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7fc1Lq3tEEPo9NZlxBYxSolqOF6sb91EQJr9xYbaujE=; b=V9mCmdjlNi0pfHeTGsllnS8HRg4so/gOIo4ozJnIlbHAJRxxxfbG40BmMjv8XRQHomCqdI 0V9mL/Ccjz1w6Xo2lvmv9qasaN/wXtmSiQkI5ola4B6rqL2fMg94iR39YbPZjpQSX/fUbE nMf1geFMvdxXyak1ntKrA9peCJUg+lY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Youling Tang Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, Youling Tang Subject: Re: [PATCH] bcachefs: Fix error path of bch2_link_trans() Message-ID: References: <20240430032839.948404-1-youling.tang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240430032839.948404-1-youling.tang@linux.dev> X-Migadu-Flow: FLOW_OUT On Tue, Apr 30, 2024 at 11:28:39AM +0800, Youling Tang wrote: > From: Youling Tang > > In bch2_link_trans(), if bch2_inode_nlink_inc() fails, it needs to > call bch2_trans_iter_exit() in the error path. Thanks - applied. > > Signed-off-by: Youling Tang > --- > fs/bcachefs/fs-common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c > index 6c737def357e..508d029ac53d 100644 > --- a/fs/bcachefs/fs-common.c > +++ b/fs/bcachefs/fs-common.c > @@ -200,12 +200,12 @@ int bch2_link_trans(struct btree_trans *trans, > > ret = bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_intent); > if (ret) > - goto err; > + return ret; > > inode_u->bi_ctime = now; > ret = bch2_inode_nlink_inc(inode_u); > if (ret) > - return ret; > + goto err; > > ret = bch2_inode_peek(trans, &dir_iter, dir_u, dir, BTREE_ITER_intent); > if (ret) > -- > 2.34.1 >