projects
/
~shefty
/
rdma-dev.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ioprio: rcu_read_lock/unlock protect find_task_by_vpid call (V2)
[~shefty/rdma-dev.git]
/
fs
/
ioprio.c
diff --git
a/fs/ioprio.c
b/fs/ioprio.c
index 8def14e24c3758ed95571dd89c05d3d58586c768..2f7d05c899220e06d99ac9ecc9f8047903faa3a0 100644
(file)
--- a/
fs/ioprio.c
+++ b/
fs/ioprio.c
@@
-111,12
+111,14
@@
SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
+ rcu_read_lock();
if (!who)
p = current;
else
p = find_task_by_vpid(who);
if (p)
ret = set_task_ioprio(p, ioprio);
if (!who)
p = current;
else
p = find_task_by_vpid(who);
if (p)
ret = set_task_ioprio(p, ioprio);
+ rcu_read_unlock();
break;
case IOPRIO_WHO_PGRP:
if (!who)
break;
case IOPRIO_WHO_PGRP:
if (!who)
@@
-205,12
+207,14
@@
SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
+ rcu_read_lock();
if (!who)
p = current;
else
p = find_task_by_vpid(who);
if (p)
ret = get_task_ioprio(p);
if (!who)
p = current;
else
p = find_task_by_vpid(who);
if (p)
ret = get_task_ioprio(p);
+ rcu_read_unlock();
break;
case IOPRIO_WHO_PGRP:
if (!who)
break;
case IOPRIO_WHO_PGRP:
if (!who)