From: Andreas Dilger <adilger@dilger.ca>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
Theodore Ts'o <tytso@mit.edu>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 6/6] ext4: calculate rec_len of ".." with correct name length 2
Date: Fri, 20 Dec 2024 13:38:47 -0700 [thread overview]
Message-ID: <CFF7E7F5-FCF4-4F79-9A12-CF5937BB93AC@dilger.ca> (raw)
In-Reply-To: <0fee3433-1255-42ab-80c6-63a1d9f9d47b@web.de>
[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]
On Dec 20, 2024, at 6:52 AM, Markus Elfring <Markus.Elfring@web.de> wrote:
>
>> The rec_len of directory ".." should be ext4_dir_rec_len(2, NULL) instead
>> of ext4_dir_rec_len(1, NULL). Although ext4_dir_rec_len return the same
>> number either with name_len 1 or name_len 2, it's better use the right
>> name_len to make code more intuitive.
>
> Do you try to point a correctness issue out here?
>
> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc3#n145
The patch is a no-op in terms of functionality. Dirent lengths are rounded up to a multiple of 4 bytes, so "1" and "2" give the same value.
I was looking back at the changes to this code, and it has existed
since at least when ext4 was cloned from ext3. In older versions
of the code this calculation was done *before* the
I also realized that the original code with "1" is actually correct.
This code is calculating the dirent length of the ".." entry, but
this is actually "the rest of the block minus the the '.' dirent size",
so passing "1" is correct in this case.
So this patch should not be applied.
Cheers, Andreas
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]
next prev parent reply other threads:[~2024-12-20 20:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 11:00 [PATCH 0/6] Fix and cleanups to ext4 namei.c Kemeng Shi
2024-12-19 11:00 ` [PATCH 1/6] ext4: add missing brelse for bh2 in ext4_dx_add_entry Kemeng Shi
2024-12-20 12:57 ` Ojaswin Mujoo
2024-12-20 13:15 ` Markus Elfring
2024-12-24 12:11 ` Kemeng Shi
2024-12-21 7:33 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 2/6] ext4: remove unneeded bits mask in dx_get_block() Kemeng Shi
2024-12-20 1:10 ` Andreas Dilger
2024-12-24 12:09 ` Kemeng Shi
2024-12-19 11:00 ` [PATCH 3/6] ext4: remove unneeded forward declaration in namei.c Kemeng Shi
2024-12-20 12:55 ` Ojaswin Mujoo
2024-12-21 7:34 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 4/6] ext4: remove unneeded check in get_dx_countlimit Kemeng Shi
2024-12-20 12:51 ` Ojaswin Mujoo
2024-12-24 12:10 ` Kemeng Shi
2024-12-21 7:44 ` Zhang Yi
2024-12-24 12:16 ` Kemeng Shi
2024-12-19 11:00 ` [PATCH 5/6] ext4: remove unused input "inode" in ext4_find_dest_de Kemeng Shi
2024-12-21 7:45 ` Zhang Yi
2024-12-19 11:00 ` [PATCH 6/6] ext4: calculate rec_len of ".." with correct name length 2 Kemeng Shi
2024-12-20 13:52 ` Markus Elfring
2024-12-20 20:38 ` Andreas Dilger [this message]
2024-12-24 12:15 ` Kemeng Shi
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=CFF7E7F5-FCF4-4F79-9A12-CF5937BB93AC@dilger.ca \
--to=adilger@dilger.ca \
--cc=Markus.Elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shikemeng@huaweicloud.com \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®