Re: sysctl: Reduce dput(child) calls in proc_sys_fill_cache()

From: Markus Elfring
Date: Wed Oct 23 2024 - 08:11:41 EST


>> A dput(child) call was immediately used after an error pointer check
>> for a d_splice_alias() call in this function implementation.
>> Thus call such a function instead directly before the check.
> This message reads funny, please re-write for your v2. Here is how I would write
> it.
>
> "
> Replace two dput(child) calls with one that occurs immediately before the IS_ERR
> evaluation. This is ok because dput gets called regardless of the value returned
> by IS_ERR(res).
> "

Do you prefer the mentioned macro name over the wording “error pointer check”?


>> This issue was transformed by using the Coccinelle software.
> How long is the coccinelle script? …

A related script for the semantic patch language was presented already according to
the clarification approach “Generalising a transformation with SmPL?”.
https://lore.kernel.org/kernel-janitors/300b5d1a-ab88-4548-91d2-0792bc15e15e@xxxxxx/
https://lkml.org/lkml/2024/9/14/464
https://sympa.inria.fr/sympa/arc/cocci/2024-09/msg00004.html

Will further development ideas evolve accordingly?

Regards,
Markus