mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: wen.yang@linux.dev
Cc: Joel Granados <joel.granados@kernel.org>,
	Kees Cook <kees@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 0/6] sysctl: replace overloaded extra pointers with typed bounds and core stride
Date: Mon, 16 Nov 2026 21:40:23 +0000	[thread overview]
Message-ID: <20261116214023.1a1b4205@pumpkin> (raw)
In-Reply-To: <cover.1794844686.git.wen.yang@linux.dev>

On Tue, 17 Nov 2026 00:07:32 +0800
wen.yang@linux.dev wrote:

> From: Wen Yang <wen.yang@linux.dev>
> 
> struct ctl_table has long relied on extra1 and extra2 pointers to serve
> multiple unrelated duties, including range limits and caller-specific
> context.  This series addresses both:
> 
> 1. Replace bound pointers with plain unsigned long min and max fields
>    directly in struct ctl_table.
> 
> 2. Replace per-entry context pointers with a core stride mechanism,
>    allowing callers to register arrays of structures embedding struct
>    ctl_table and recover enclosing context via standard container_of().
> 
> This RFC focuses on the core stride infrastructure and two representative
> complex users (netfilter nf_log and IPv4 devinet), as suggested by Joel
> Granados.  The remaining treewide callers are converted in a single
> squashed commit to ensure the tree builds and tests pass cleanly.

I think I would have tried to avoid the indentation changes - just to
make the actual changes easier to see.

...
> 4. Baseline rebase & conflict resolution:
>    - Rebased onto next-20261111 (aaa2f954c21b).
>    - Added proc_dointvec_jiffies_minmax and proc_dointvec_ms_jiffies_minmax
>      to sysctl_check_table().

I didn't spot those in here, but are they even needed?
Without the bounds don't the minmax variants behave like the original functions?
So it was only necessary to add support for bounds to the existing functions.
(The only think that half makes sense is if a caller uses extra1/2 for
something else.)

Related, I think you can reduce the size of the final patch and the likely hood
of some silly errors by making the 'dointvec' functions treat min == 0, max == 0
(ie no initialisers) as 'no limit' rather than 'only zero allowed'.

David

      parent reply	other threads:[~2026-11-16 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:07 wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 1/5] sysctl: add numeric bounds and core stride infrastructure wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 2/5] sysctl: cover numeric bounds and table containers in KUnit wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 3/5] netfilter: embed logger sysctl context using stride wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 4/5] net/ipv4: embed device " wen.yang
2026-11-16 16:07 ` [RFC PATCH v2 5/5] scripts/coccinelle: add script to detect and convert sysctl bounds wen.yang
2026-11-16 21:40 ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116214023.1a1b4205@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=joel.granados@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wen.yang@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®