aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-25 04:48:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:47 -0400
commit0c18d7a5df82524e634637c3aec24d4cba096442 (patch)
tree9b49f775403c77b8fe4d59f4d7c84d43e26e3f5b /kernel
parent7d1e13505be8c2bd2207894f4e0f069e1f9b51c9 (diff)
bsdacct: fix and add comments around acct_process()
Fix the one describing what this function is and add one more - about locking absence around pid namespaces loop. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index 0feba97e114e..dd68b9059418 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -657,7 +657,8 @@ static void acct_process_in_ns(struct pid_namespace *ns)
657} 657}
658 658
659/** 659/**
660 * acct_process - now just a wrapper around do_acct_process 660 * acct_process - now just a wrapper around acct_process_in_ns,
661 * which in turn is a wrapper around do_acct_process.
661 * 662 *
662 * handles process accounting for an exiting task 663 * handles process accounting for an exiting task
663 */ 664 */
@@ -665,6 +666,11 @@ void acct_process(void)
665{ 666{
666 struct pid_namespace *ns; 667 struct pid_namespace *ns;
667 668
669 /*
670 * This loop is safe lockless, since current is still
671 * alive and holds its namespace, which in turn holds
672 * its parent.
673 */
668 for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent) 674 for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
669 acct_process_in_ns(ns); 675 acct_process_in_ns(ns);
670} 676}