aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ioprio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ioprio.c')
-rw-r--r--fs/ioprio.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c
index 0fd1089d7bf6..03dc4f269b76 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -81,7 +81,12 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
81 } 81 }
82 82
83 ret = -ESRCH; 83 ret = -ESRCH;
84 read_lock_irq(&tasklist_lock); 84 /*
85 * We want IOPRIO_WHO_PGRP/IOPRIO_WHO_USER to be "atomic",
86 * so we can't use rcu_read_lock(). See re-copy of ->ioprio
87 * in copy_process().
88 */
89 read_lock(&tasklist_lock);
85 switch (which) { 90 switch (which) {
86 case IOPRIO_WHO_PROCESS: 91 case IOPRIO_WHO_PROCESS:
87 if (!who) 92 if (!who)
@@ -124,7 +129,7 @@ free_uid:
124 ret = -EINVAL; 129 ret = -EINVAL;
125 } 130 }
126 131
127 read_unlock_irq(&tasklist_lock); 132 read_unlock(&tasklist_lock);
128 return ret; 133 return ret;
129} 134}
130 135
@@ -170,7 +175,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
170 int ret = -ESRCH; 175 int ret = -ESRCH;
171 int tmpio; 176 int tmpio;
172 177
173 read_lock_irq(&tasklist_lock); 178 read_lock(&tasklist_lock);
174 switch (which) { 179 switch (which) {
175 case IOPRIO_WHO_PROCESS: 180 case IOPRIO_WHO_PROCESS:
176 if (!who) 181 if (!who)
@@ -221,7 +226,7 @@ asmlinkage long sys_ioprio_get(int which, int who)
221 ret = -EINVAL; 226 ret = -EINVAL;
222 } 227 }
223 228
224 read_unlock_irq(&tasklist_lock); 229 read_unlock(&tasklist_lock);
225 return ret; 230 return ret;
226} 231}
227 232