[Devel] [PATCH RHEL9 COMMIT] Revert "sysctl: return -EINVAL if val violates minmax"

Konstantin Khorenko khorenko at virtuozzo.com
Fri Oct 22 12:51:30 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.15
------>
commit e95d79f136fef16c7a0573122f52ed23321862d3
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Fri Oct 22 12:44:34 2021 +0300

    Revert "sysctl: return -EINVAL if val violates minmax"
    
    This reverts commit e260ad01f0aa9e96b5386d5cd7184afd949dc457.
    
    Virtuozzo Linux 8 environment (userspace) is not ready for that kind of
    sysctl writes failures, so while we build vz9 as vz8 userspace + vz9
    kernel let's revert this patch.
    
    Will drop this revert once we switch fo vl9 userspace in vz9.
    
    https://jira.sw.ru/browse/PSBM-135010
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/sysctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 9bb8935f9b55..bc54de3f236f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1270,10 +1270,8 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table,
 			if (neg)
 				continue;
 			val = convmul * val / convdiv;
-			if ((min && val < *min) || (max && val > *max)) {
-				err = -EINVAL;
-				break;
-			}
+			if ((min && val < *min) || (max && val > *max))
+				continue;
 			*i = val;
 		} else {
 			val = convdiv * (*i) / convmul;


More information about the Devel mailing list