diff --git a/block/ioprio.c b/block/ioprio.c index 84da6c71b2ccba53ad6530dd75e8aac405b27f7b..c8878647de40094ee7c3ab7f2e49c20edffa0048 100644 --- a/block/ioprio.c +++ b/block/ioprio.c @@ -214,6 +214,7 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) pgrp = task_pgrp(current); else pgrp = find_vpid(who); + read_lock(&tasklist_lock); do_each_pid_thread(pgrp, PIDTYPE_PGID, p) { tmpio = get_task_ioprio(p); if (tmpio < 0) @@ -223,6 +224,8 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) else ret = ioprio_best(ret, tmpio); } while_each_pid_thread(pgrp, PIDTYPE_PGID, p); + read_unlock(&tasklist_lock); + break; case IOPRIO_WHO_USER: uid = make_kuid(current_user_ns(), who);