All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [Devel] [PATCH RHEL10 COMMIT] drivers/base/cpu: fix cpu/offline content inside a ve
Date: Wed, 5 Aug 2026 22:05:10 +0200	[thread overview]
Message-ID: <202608052005.675K5AA4539628@f0.sw.ru> (raw)
In-Reply-To: <20260706110002.1024515-17-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 fdfa48283061fcd77b59e4ba7d182d8af3e4198e
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
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 <khorenko@virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 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))

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

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260706110002.1024515-17-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=202608052005.675K5AA4539628@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.