From 3560071ae86bc78a0b4eafff5911a553e7651f64 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 15 Jan 2012 09:03:38 +0100 Subject: [PATCH] do not forbid other processes to use the pwqr fd. Actually it could even make sense, to have stuff running in the background and wanting to be accounted in the overall load of this process group (for example some kind of snapshot procedure that would be forke()d in the background). Plus this restriction was kind of un-kernelish. Signed-off-by: Pierre Habouzit --- kernel/pwqr.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/pwqr.c b/kernel/pwqr.c index 8592a00..a6ff8e5 100644 --- a/kernel/pwqr.c +++ b/kernel/pwqr.c @@ -60,7 +60,6 @@ struct pwqr_sb { struct rcu_head rcu; struct timer_list timer; wait_queue_head_t wqh; - pid_t tgid; unsigned concurrency; unsigned registered; @@ -149,8 +148,7 @@ static struct pwqr_sb *pwqr_sb_create(void) kref_init(&sb->kref); init_waitqueue_head(&sb->wqh); - sb->tgid = current->tgid; - sb->concurrency = num_online_cpus(); + sb->concurrency = num_online_cpus(); init_timer(&sb->timer); sb->timer.function = pwqr_sb_timer_cb; sb->timer.data = (unsigned long)sb; @@ -374,7 +372,7 @@ static int pwqr_release(struct inode *inode, struct file *filp) static long do_pwqr_wait(struct pwqr_sb *sb, struct pwqr_task *pwqt, - int is_wait, struct pwqr_ioc_wait __user *arg) + int is_wait, struct pwqr_ioc_wait __user *arg) { unsigned long flags; struct pwqr_ioc_wait wait; @@ -563,9 +561,6 @@ static long pwqr_ioctl(struct file *filp, unsigned command, unsigned long arg) struct pwqr_task *pwqt; int rc = 0; - if (sb->tgid != current->tgid) - return -EBADFD; - switch (command) { case PWQR_GET_CONC: return sb->concurrency; -- 2.20.1