[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4809330-6d07-b35d-7c2c-404ae5063f51@huaweicloud.com>
Date: Tue, 24 Dec 2024 20:15:50 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Andreas Dilger <adilger@...ger.ca>, Markus Elfring <Markus.Elfring@....de>
Cc: 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 12/21/2024 4:38 AM, Andreas Dilger wrote:
> 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.
Ahh, right... Thanks for point this out. Will drop this in next version.
Thanks,
Kemeng
>
>
> Cheers, Andreas
>
>
>
>
>
Powered by blists - more mailing lists