[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CFF7E7F5-FCF4-4F79-9A12-CF5937BB93AC@dilger.ca>
Date: Fri, 20 Dec 2024 13:38:47 -0700
From: Andreas Dilger <adilger@...ger.ca>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Kemeng Shi <shikemeng@...weicloud.com>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Theodore Ts'o <tytso@....edu>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 6/6] ext4: calculate rec_len of ".." with correct name
length 2
On Dec 20, 2024, at 6:52 AM, Markus Elfring <Markus.Elfring@....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
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists