Re: [PATCH 1/3] DEBUGFS: Automatically create parents for debugfsfiles v2

From: Cyrill Gorcunov
Date: Tue Dec 13 2011 - 17:23:04 EST


On Tue, Dec 13, 2011 at 01:45:32PM -0800, Andi Kleen wrote:
>
> +/*
> + * Created parents stay around later. Sorry, but it shouldn't be a big issue.
> + */
> +static const char *create_parents(const char *name, struct dentry *parent,
> + struct dentry **pp, int *ref)
> +{
> + char fn[strlen(name) + 1];
> + char *tail;
> + char *s, *p;
> + struct dentry *new_parent, *dentry, *old_parent = NULL;
> +
> + strcpy(fn, name);
> + tail = strrchr(fn, '/');
> + if (!tail)
> + return name;
> + tail++;
> +

Hi Andi, is it possible to do say kstrdup or something instead of
variable-size array in fn[strlen(name) + 1] ? As far as I remember
we already had some warnings with them at least in perf land (or
trace land). Or I miss something?

Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/