lkml.org 
[lkml]   [2008]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] oom: print triggering task's cpuset and mems allowed
On Tue, 28 Oct 2008 09:08:15 -0700 (PDT)
David Rientjes <rientjes@google.com> wrote:

> +#define CPUSET_NAME_LEN (128)
> +#define CPUSET_NODELIST_LEN (256)
> +static char cpuset_name[CPUSET_NAME_LEN];
> +static char cpuset_nodelist[CPUSET_NODELIST_LEN];
>
> ...
>
> + snprintf(cpuset_name, CPUSET_NAME_LEN,
> + dentry ? (const char *)dentry->d_name.name : "/");

nit: this requires that the reviewer (and the maintainer) ensure that
CPUSET_NAME_LEN=sizeof(cpuset_name). This must be done manually and
introduces risk.

Better would be:


static char cpuset_name[128];

...

snprintf(cpuset_name, sizeof(cpuset_name), ...);



\
 
 \ /
  Last update: 2008-10-28 22:45    [W:0.071 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site