aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-09-29 05:00:52 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:18 -0400
commit5b160f5ecd2f1b6df2e0015dc1f319c8ef803d62 (patch)
treeff7f77b4178299146d6450f01f5d1da769c3fda9 /kernel
parent1c573afebc6213e4372e0d8352034c23d5262e1f (diff)
[PATCH] copy_process: cosmetic ->ioprio tweak
copy_process: // holds tasklist_lock + ->siglock /* * inherit ioprio */ p->ioprio = current->ioprio; Why? ->ioprio was already copied in dup_task_struct(). I guess this is needed to ensure that the child can't escape sys_ioprio_set(IOPRIO_WHO_{PGRP,USER}), yes? In that case we don't need ->siglock held, and the comment should be updated. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index bca6ce6d3ded..1c999f3e0b47 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1150,7 +1150,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1150 1150
1151 /* Our parent execution domain becomes current domain 1151 /* Our parent execution domain becomes current domain
1152 These must match for thread signalling to apply */ 1152 These must match for thread signalling to apply */
1153
1154 p->parent_exec_id = p->self_exec_id; 1153 p->parent_exec_id = p->self_exec_id;
1155 1154
1156 /* ok, now we should be set up.. */ 1155 /* ok, now we should be set up.. */
@@ -1173,6 +1172,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1173 /* Need tasklist lock for parent etc handling! */ 1172 /* Need tasklist lock for parent etc handling! */
1174 write_lock_irq(&tasklist_lock); 1173 write_lock_irq(&tasklist_lock);
1175 1174
1175 /* for sys_ioprio_set(IOPRIO_WHO_PGRP) */
1176 p->ioprio = current->ioprio;
1177
1176 /* 1178 /*
1177 * The task hasn't been attached yet, so its cpus_allowed mask will 1179 * The task hasn't been attached yet, so its cpus_allowed mask will
1178 * not be changed, nor will its assigned CPU. 1180 * not be changed, nor will its assigned CPU.
@@ -1232,11 +1234,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1232 } 1234 }
1233 } 1235 }
1234 1236
1235 /*
1236 * inherit ioprio
1237 */
1238 p->ioprio = current->ioprio;
1239
1240 if (likely(p->pid)) { 1237 if (likely(p->pid)) {
1241 add_parent(p); 1238 add_parent(p);
1242 if (unlikely(p->ptrace & PT_PTRACED)) 1239 if (unlikely(p->ptrace & PT_PTRACED))