Re: [PATCH 6/6] ext4: calculate rec_len of ".." with correct name length 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 20, 2024, at 6:52 AM, Markus Elfring <Markus.Elfring@xxxxxx> 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: signature.asc
Description: Message signed with OpenPGP


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux