diff options
Diffstat (limited to 'kernel/tsacct.c')
| -rw-r--r-- | kernel/tsacct.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 23b4d784ebdd..625df0b44690 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
| @@ -26,7 +26,9 @@ | |||
| 26 | /* | 26 | /* |
| 27 | * fill in basic accounting fields | 27 | * fill in basic accounting fields |
| 28 | */ | 28 | */ |
| 29 | void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | 29 | void bacct_add_tsk(struct user_namespace *user_ns, |
| 30 | struct pid_namespace *pid_ns, | ||
| 31 | struct taskstats *stats, struct task_struct *tsk) | ||
| 30 | { | 32 | { |
| 31 | const struct cred *tcred; | 33 | const struct cred *tcred; |
| 32 | struct timespec uptime, ts; | 34 | struct timespec uptime, ts; |
| @@ -55,13 +57,13 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | |||
| 55 | stats->ac_flag |= AXSIG; | 57 | stats->ac_flag |= AXSIG; |
| 56 | stats->ac_nice = task_nice(tsk); | 58 | stats->ac_nice = task_nice(tsk); |
| 57 | stats->ac_sched = tsk->policy; | 59 | stats->ac_sched = tsk->policy; |
| 58 | stats->ac_pid = tsk->pid; | 60 | stats->ac_pid = task_pid_nr_ns(tsk, pid_ns); |
| 59 | rcu_read_lock(); | 61 | rcu_read_lock(); |
| 60 | tcred = __task_cred(tsk); | 62 | tcred = __task_cred(tsk); |
| 61 | stats->ac_uid = tcred->uid; | 63 | stats->ac_uid = from_kuid_munged(user_ns, tcred->uid); |
| 62 | stats->ac_gid = tcred->gid; | 64 | stats->ac_gid = from_kgid_munged(user_ns, tcred->gid); |
| 63 | stats->ac_ppid = pid_alive(tsk) ? | 65 | stats->ac_ppid = pid_alive(tsk) ? |
| 64 | rcu_dereference(tsk->real_parent)->tgid : 0; | 66 | task_tgid_nr_ns(rcu_dereference(tsk->real_parent), pid_ns) : 0; |
| 65 | rcu_read_unlock(); | 67 | rcu_read_unlock(); |
| 66 | stats->ac_utime = cputime_to_usecs(tsk->utime); | 68 | stats->ac_utime = cputime_to_usecs(tsk->utime); |
| 67 | stats->ac_stime = cputime_to_usecs(tsk->stime); | 69 | stats->ac_stime = cputime_to_usecs(tsk->stime); |
