Andrew Morton noted in http://lkml.org/lkml/2006/6/30/247 """We do occasionally hit task_struct.comm[] truncation, when people use "too-long-a-name%d" for their kernel thread names.""" This patch warns when such a truncation happens. Already posted on http://lkml.org/lkml/2006/7/3/93 Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Cc: Andrew Morton <akpm@linux-foundation.org> kthread.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Index: linux-2.6.21-rc5/kernel/kthread.c =================================================================== --- linux-2.6.21-rc5.orig/kernel/kthread.c +++ linux-2.6.21-rc5/kernel/kthread.c @@ -176,8 +176,11 @@ struct task_struct *kthread_create(int ( if (!IS_ERR(create.result)) { va_list args; va_start(args, namefmt); - vsnprintf(create.result->comm, sizeof(create.result->comm), - namefmt, args); + if(vsnprintf(create.result->comm, sizeof(create.result->comm), + namefmt, args) != strlen(create.result->comm)) + printk(KERN_WARNING "kthread_create: command name of " + "pid %d truncated to \"%s\"\n", create.result->pid, + create.result->comm); va_end(args); } #<EOF> -
| Andrew Morton | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc5 |
| David Miller | Re: [PATCH] net: Fix the prototype of call_netdevice_notifiers |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
