aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Williams <pwil3058@bigpond.net.au>2006-06-26 02:58:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:02:41 -0400
commitb78709cfd4387c15a9894748bcada8a4ca75c561 (patch)
tree999f5beae5983280fa1c3d98cefb47ee4a95d83b
parent2139a7fbf3effd8cad505871e3a3c308780ada32 (diff)
[PATCH] sched: fix SCHED_FIFO bug in sys_sched_rr_get_interval()
The introduction of SCHED_BATCH scheduling class with a value of 3 means that the expression (p->policy & SCHED_FIFO) will return true if policy is SCHED_BATCH or SCHED_FIFO. Unfortunately, this expression is used in sys_sched_rr_get_interval() and in the absence of a comment to say that this is intentional I presume that it is unintentional and erroneous. The fix is to change the expression to (p->policy == SCHED_FIFO). Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f06d059edef5..cfaf3fabeecd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4247,7 +4247,7 @@ long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
4247 if (retval) 4247 if (retval)
4248 goto out_unlock; 4248 goto out_unlock;
4249 4249
4250 jiffies_to_timespec(p->policy & SCHED_FIFO ? 4250 jiffies_to_timespec(p->policy == SCHED_FIFO ?
4251 0 : task_timeslice(p), &t); 4251 0 : task_timeslice(p), &t);
4252 read_unlock(&tasklist_lock); 4252 read_unlock(&tasklist_lock);
4253 retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0; 4253 retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0;