* The acct_process() call is the workhorse of the process
* accounting system. The struct acct is built here and then written
* into the accounting file. This function should only be called from
- * do_exit().
+ * do_exit() or when switching to a different output file.
*/
/*
#endif
#if ACCT_VERSION==3
ac.ac_pid = current->tgid;
- ac.ac_ppid = current->parent->tgid;
+ rcu_read_lock();
+ ac.ac_ppid = rcu_dereference(current->real_parent)->tgid;
+ rcu_read_unlock();
#endif
spin_lock_irq(¤t->sighand->siglock);