From: Youling Tang <youling.tang@linux.dev>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org,
Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH] bcachefs: Remove the handling of bch2_trans_iter_exit() in __bch2_bkey_get_iter()
Date: Fri, 23 Aug 2024 14:07:20 +0800 [thread overview]
Message-ID: <f9f50184-364c-4082-bf19-ea953c3c1429@linux.dev> (raw)
In-Reply-To: <f2uohiy7zaaiv33r7xhofaprv6tk5mumvzzf7plvagdtavrini@3orfgcehid7q>
On 23/08/2024 11:55, Kent Overstreet wrote:
> On Fri, Aug 23, 2024 at 11:19:55AM GMT, Youling Tang wrote:
>> From: Youling Tang <tangyouling@kylinos.cn>
>>
>> - Reduces bkey_err() calls.
>> - Avoid redundant calls to bch2_trans_iter_exit() in some functions.
> no, a function that returns an error should clean up after itself
Yes, functions should self-clean when they fail.
However, there are repeated calls to bch2_trans_iter_exit in
some functions, take lookup_inode() as an example,
When bkey_err(k) returns a non-zero, call bch2_trans_iter_exit()
once in bch2_bkey_get_iter(). It is then called again in
lookup_inode() via 'goto err'. (We can correct it by simply changing
it to 'return ret', but there are many similar cases.)
Thanks,
Youling.
next prev parent reply other threads:[~2024-08-23 6:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 3:19 [PATCH] bcachefs: Remove the handling of bch2_trans_iter_exit() in __bch2_bkey_get_iter() Youling Tang
2024-08-23 3:55 ` Kent Overstreet
2024-08-23 6:07 ` Youling Tang [this message]
2024-08-23 14:51 ` Kent Overstreet
2024-08-30 1:19 ` Youling Tang
2024-08-30 3:48 ` Hongbo Li
2024-08-30 3:53 ` Hongbo Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f9f50184-364c-4082-bf19-ea953c3c1429@linux.dev \
--to=youling.tang@linux.dev \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tangyouling@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox