[PATCH v2] Loongarch: adapt for the re-introduction of fstat and newfstatat in 6.11
Miao Wang
shankerwangmiao@gmail.com
Tue Aug 20 16:01:00 GMT 2024
Hi,
> 2024年8月20日 23:11,Xi Ruoyao <xry111@xry111.site> 写道:
>
> On Tue, 2024-08-20 at 23:06 +0800, Xi Ruoyao wrote:
>> On Tue, 2024-08-20 at 22:12 +0800, Miao Wang via B4 Relay wrote:
>>> From: Miao Wang <shankerwangmiao@gmail.com>
>>>
>>> In Linux 6.11, fstat and newfstatat are added back. We need to include
>>> this change in kernel-features.h to avoid producing libraries
>>> incompatible with previous linux versions with new headers.
>>>
>>> The definition of the two syscalls will be removed when the targeted
>>> kernel version is below 6.11 in loongarch/sysdep.h.
>>>
>>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>>
>> You should resolve the previous review comments before sending a new
>> version. If you don't agree with 6.10.6 then fine to leave the code
>> unchanged but you need to explain the reason in the commit message. And
>> to me "I think the backport is questionable" isn't a good reason (i.e.
>> we need the reason it's questionable, not just "it's questionable").
>
> Actually "the reason it's *wrong*," not just "questionable." Everything
> can be questionable.
I don't think the choice between 6.10.6 or 6.11 should be a major problem.
Because the macro __LINUX_KERNEL_VERSION here, is not the kernel glibc is
running with, nor the kernel headers glibc is compiled with, but actually
a compile option specified by the user via the configure command line, i.e.
--enable-kernel, which will be, if absent, in the context of loongarch,
5.19.
I tend to choose 6.11, instead of 6.10.6, based on the following reasons:
1. Most of other kernel version comparing statements contains only the minor
version. Actually, there is only one occurrence of comparing with the patch
version, if I did not miss anything.
2. As you've pointed before, I quote, "non-Linus forks of the kernel aren't
supported", end of quote, 6.10.6 is not in Linus' kernel tree, but 6.11 is.
3. Backporting makes the mapping between version numbers and features in a
non-linear way. If version numbers in the stable tree should also be
considered, saying kernel versions >= 6.10.6 supports fstat and newfstatat,
it would be unfair to ignore versions >= 6.6.47 and < 6.7, versions >=
6.1.106 and < 6.2. So I would prefer using 6.11, i.e. the version in the
Torvalds' tree.
I'll leave 6.11 unchanged in my patch. Since this patch will not get merged
before someone refreshes all the syscall definitions with the 6.11 kernel,
I expect further discussions can make this clearer.
Cheers,
Miao Wang
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
More information about the Libc-alpha
mailing list