[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <177011752387.2495410.9792559304780287128.tip-bot2@tip-bot2>
Date: Tue, 03 Feb 2026 11:18:43 -0000
From: "tip-bot2 for Joel Fernandes" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Joel Fernandes <joelagnelf@...dia.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Andrea Righi <arighi@...dia.com>,
Tejun Heo <tj@...nel.org>, Christian Loehle <christian.loehle@....com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
[tip: sched/core] sched/debug: Fix updating of ppos on server write ops
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 6080fb211672aec6ce8f2f5a2e0b4eae736f2027
Gitweb: https://git.kernel.org/tip/6080fb211672aec6ce8f2f5a2e0b4eae736f2027
Author: Joel Fernandes <joelagnelf@...dia.com>
AuthorDate: Mon, 26 Jan 2026 10:59:00 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 03 Feb 2026 12:04:16 +01:00
sched/debug: Fix updating of ppos on server write ops
Updating "ppos" on error conditions does not make much sense. The pattern
is to return the error code directly without modifying the position, or
modify the position on success and return the number of bytes written.
Since on success, the return value of apply is 0, there is no point in
modifying ppos either. Fix it by removing all this and just returning
error code or number of bytes written on success.
Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Juri Lelli <juri.lelli@...hat.com>
Reviewed-by: Andrea Righi <arighi@...dia.com>
Acked-by: Tejun Heo <tj@...nel.org>
Tested-by: Christian Loehle <christian.loehle@....com>
Link: https://patch.msgid.link/20260126100050.3854740-3-arighi@nvidia.com
---
kernel/sched/debug.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 929fdf0..ed9254d 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -339,8 +339,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
long cpu = (long) ((struct seq_file *) filp->private_data)->private;
struct rq *rq = cpu_rq(cpu);
u64 runtime, period;
+ int retval = 0;
size_t err;
- int retval;
u64 value;
err = kstrtoull_from_user(ubuf, cnt, 10, &value);
@@ -374,8 +374,6 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
dl_server_stop(&rq->fair_server);
retval = dl_server_apply_params(&rq->fair_server, runtime, period, 0);
- if (retval)
- cnt = retval;
if (!runtime)
printk_deferred("Fair server disabled in CPU %d, system may crash due to starvation.\n",
@@ -383,6 +381,9 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
if (rq->cfs.h_nr_queued)
dl_server_start(&rq->fair_server);
+
+ if (retval < 0)
+ return retval;
}
*ppos += cnt;
Powered by blists - more mailing lists