Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] comments on locking of task->comm

Add some comments about task->comm, to explain what it is near its definition
and provide some important pointers to its uses.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paolo 'Blaisorblade' Giarrusso and committed by
Linus Torvalds
36772092 291c4a75

+8 -3
+3 -1
fs/exec.c
··· 869 869 if (current->euid == current->uid && current->egid == current->gid) 870 870 current->mm->dumpable = 1; 871 871 name = bprm->filename; 872 + 873 + /* Copies the binary name from after last slash */ 872 874 for (i=0; (ch = *(name++)) != '\0';) { 873 875 if (ch == '/') 874 - i = 0; 876 + i = 0; /* overwrite what we wrote */ 875 877 else 876 878 if (i < (sizeof(tcomm) - 1)) 877 879 tcomm[i++] = ch;
+5 -2
include/linux/sched.h
··· 578 578 unsigned long flags; /* per process flags, defined below */ 579 579 unsigned long ptrace; 580 580 581 - int lock_depth; /* Lock depth */ 581 + int lock_depth; /* BKL lock depth */ 582 582 583 583 int prio, static_prio; 584 584 struct list_head run_list; ··· 661 661 struct key *thread_keyring; /* keyring private to this thread */ 662 662 #endif 663 663 int oomkilladj; /* OOM kill score adjustment (bit shift). */ 664 - char comm[TASK_COMM_LEN]; 664 + char comm[TASK_COMM_LEN]; /* executable name excluding path 665 + - access with [gs]et_task_comm (which lock 666 + it with task_lock()) 667 + - initialized normally by flush_old_exec */ 665 668 /* file system info */ 666 669 int link_count, total_link_count; 667 670 /* ipc stuff */