Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

From: Eric W. Biederman
Date: Wed Dec 13 2023 - 13:18:16 EST


Luis Chamberlain <mcgrof@xxxxxxxxxx> writes:

> On Mon, Dec 11, 2023 at 12:25:10PM +0100, Thomas Weißschuh wrote:
>> Before sending it I'd like to get feedback on the internal rework of the
>> is_empty detection from you and/or Luis.
>>
>> https://git.sr.ht/~t-8ch/linux/commit/ea27507070f3c47be6febebe451bbb88f6ea707e
>> or the attached patch.
>
> Please send as a new patch as RFC and please ensure on the To field is
> first "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> with a bit more
> elaborate commit log as suggested from my review below. If there are
> any hidden things me and Joel could probably miss I'm sure Eric will
> be easily able to spot it.
>
>> From ea27507070f3c47be6febebe451bbb88f6ea707e Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <linux@xxxxxxxxxxxxxx>
>> Date: Sun, 3 Dec 2023 21:56:46 +0100
>> Subject: [PATCH] sysctl: move permanently empty flag to ctl_dir
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> Simplify the logic by always keeping the permanently_empty flag on the
>> ctl_dir.
>> The previous logic kept the flag in the leaf ctl_table and from there
>> transferred it to the ctl_table from the directory.
>>
>> This also removes the need to have a mutable ctl_table and will allow
>> the constification of those structs.

> Please elaborate a bit more on this here in your next RFC.

> It's a pretty aggressive cleanup, specially with the new hipster guard()
> call but I'd love Eric's eyeballs on a proper v2.

I will look at a v2 time permitting.

My sense is that changing the locking probably make sense as a separate
patch.

Eric