From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Wed, 5 Aug 2026 22:05:10 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] drivers/base/cpu: fix cpu/offline content inside a ve In-Reply-To: <20260706110002.1024515-17-khorenko@virtuozzo.com> Message-ID: <202608052005.675K5AA4539628@f0.sw.ru> List-Id: 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 fdfa48283061fcd77b59e4ba7d182d8af3e4198e Author: Konstantin Khorenko Date: Mon Jul 6 12:59:54 2026 +0200 drivers/base/cpu: fix cpu/offline content inside a ve print_cpus_offline()'s non-super-ve early return passed len (declared 0 at that point, used later only as the sysfs_emit_at() accumulator) as snprintf()'s size argument, so nothing was ever written to buf. Since sysfs zeroes the page before calling show(), reading /sys/devices/system/cpu/offline from inside a ve returned a single NUL byte instead of the intended empty line ("\n"). Fixes: 44a8c49297f94 ("ve/cpu: handle sysfs attributes for CTs") Feature: sysfs: per-CT entries visibility and permissions configuration https://virtuozzo.atlassian.net/browse/VSTOR-137234 Signed-off-by: Konstantin Khorenko Reviewed-by: Pavel Tikhomirov --- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 1e992254b12c6..b7ddc8346603c 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -263,7 +263,7 @@ static ssize_t print_cpus_offline(struct device *dev, cpumask_var_t offline; if (!ve_is_super(get_exec_env())) - return snprintf(buf, len, "\n"); + return sysfs_emit(buf, "\n"); /* display offline cpus < nr_cpu_ids */ if (!alloc_cpumask_var(&offline, GFP_KERNEL))