All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [Devel] [PATCH RHEL10 COMMIT] ve/mm: enforce the 0..100 bound on vfs_cache_min_ratio
Date: Wed, 5 Aug 2026 14:01:15 +0200	[thread overview]
Message-ID: <202608051201.675C1FNn498560@f0.sw.ru> (raw)
In-Reply-To: <20260706110002.1024515-5-khorenko@virtuozzo.com>

The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.2.vz10
------>
commit caffa03f46b7f603cc9b187322ad80332f44e423
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Mon Jul 6 12:59:42 2026 +0200

    ve/mm: enforce the 0..100 bound on vfs_cache_min_ratio
    
    The vfs_cache_min_ratio sysctl was registered with
      .extra1 = SYSCTL_ZERO
      .extra2 = SYSCTL_ONE_HUNDRED
    but with .proc_handler = proc_dointvec.
    
    proc_dointvec() ignores extra1/extra2, so the intended [0, 100] clamp
    was never applied and any value (e.g. 101 or negative) was accepted.
    
    Use proc_dointvec_minmax() so the already-declared bounds are honoured
    and an out-of-range write is rejected with -EINVAL.
    
    Fixes: b1d8855b18e5b ("ve/mm: introduce min threshold for dcache")
    Feature: mm: threshold for minimal dcache amount
    https://virtuozzo.atlassian.net/browse/VSTOR-137234
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8bb2c2de769e2..cd2d91dca858c 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2161,7 +2161,7 @@ static struct ctl_table vm_table[] = {
 		.data           = &sysctl_vfs_cache_min_ratio,
 		.maxlen         = sizeof(sysctl_vfs_cache_min_ratio),
 		.mode           = 0644,
-		.proc_handler   = proc_dointvec,
+		.proc_handler   = proc_dointvec_minmax,
 		.extra1         = SYSCTL_ZERO,
 		.extra2         = SYSCTL_ONE_HUNDRED,
 	},

           reply	other threads:[~2026-08-05 12:01 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260706110002.1024515-5-khorenko@virtuozzo.com>]

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=202608051201.675C1FNn498560@f0.sw.ru \
    --to=khorenko@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.