From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Cole Munz <Munzzyy1@proton.me>, Alexey Charkov <alchark@flipper.net>
Cc: u-boot@lists.denx.de, Marek Behun <kabel@kernel.org>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] fs: btrfs: report file sizes from readdir
Date: Sun, 2 Aug 2026 17:25:01 +0930 [thread overview]
Message-ID: <d95529ec-3da5-443b-8c05-776309f06ada@gmx.com> (raw)
In-Reply-To: <hTFbDtB7gXE4tGU0EwriHsWY9lutwDK1ehYABepLafBuF5IDEY1rjTUVvCFq0HOsdgpfpFHvayOonotnzsuHWxs-FnRFFsnKUKmvGSkQAHI=@proton.me>
在 2026/8/2 17:07, Cole Munz 写道:
> On 2026/8/2 16:17, Qu Wenruo wrote:
>> The function btrfs_read_next_dirty_entry() is search the key inside the
>> parent directory.
>>
>> Meanwhile this one is search for the inode item of the child entry.
>>
>> They are completely different and I didn't see why "refactor" can improve.
>
> Right, the two searches are for different keys and cannot be merged.
> The repetition v2 removes is elsewhere. btrfs_size() open codes the
> same inode item search, and its error path never releases the path.
OK, the u-boot's btrfs_search_slot() is different from kernel and progs,
that on error it doesn't release the path.
So indeed we need to properly clean it up.
Although I'd prefer to change btrfs_search_slot() in u-boot to follow
the same kernel/progs behavior.
For the new helper, btrfs_get_inode_size(), is indeed called in both
btrfs_size() and btrfs_readdir(), so there is indeed some duplication.
> That leaks the extent buffers btrfs_search_slot() attached before
> failing. So v2 mixed a cleanup into a fix, which was the real
> mistake here.
>
> How about a v3 with the fix back in the v1 shape, plus a second patch
> for the btrfs_size() helper and the missing release?
>
That sounds very reasonable to me.
Thanks,
Qu
next prev parent reply other threads:[~2026-08-02 7:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 5:42 [PATCH] fs: btrfs: report file sizes from readdir Cole Munz
2026-08-02 6:02 ` Alexey Charkov
2026-08-02 6:44 ` [PATCH v2] " Cole Munz
2026-08-02 6:47 ` [PATCH] " Qu Wenruo
2026-08-02 7:37 ` Cole Munz
2026-08-02 7:55 ` Qu Wenruo [this message]
2026-08-02 9:35 ` [PATCH v3 0/3] " Cole Munz
2026-08-02 9:35 ` [PATCH v3 1/3] " Cole Munz
2026-08-02 9:35 ` [PATCH v3 2/3] fs: btrfs: release the path when btrfs_search_slot() fails Cole Munz
2026-08-02 9:35 ` [PATCH v3 3/3] fs: btrfs: deduplicate the inode size lookup Cole Munz
2026-08-02 22:08 ` [PATCH v3 0/3] fs: btrfs: report file sizes from readdir Qu Wenruo
2026-08-10 20:53 ` Tom Rini
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=d95529ec-3da5-443b-8c05-776309f06ada@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=Munzzyy1@proton.me \
--cc=alchark@flipper.net \
--cc=kabel@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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