Re: [RFC 1/3] procfs: parse mount options

From: AmÃrico Wang
Date: Tue Nov 15 2011 - 06:48:16 EST


On Tue, Nov 15, 2011 at 7:21 PM, Vasiliy Kulikov <segoon@xxxxxxxxxxxx> wrote:
> +
> +static int proc_parse_options(char *options, struct pid_namespace *pid)
> +{
> + Â Â Â char *p;
> + Â Â Â substring_t args[MAX_OPT_ARGS];
> + Â Â Â int option;


'option' is unused?

> +
> + Â Â Â pr_debug("proc: options = %s\n", options);
> +
> + Â Â Â if (!options)
> + Â Â Â Â Â Â Â return 1;
> +
> + Â Â Â while ((p = strsep(&options, ",")) != NULL) {
> + Â Â Â Â Â Â Â int token;
> + Â Â Â Â Â Â Â if (!*p)
> + Â Â Â Â Â Â Â Â Â Â Â continue;
> +
> + Â Â Â Â Â Â Â args[0].to = args[0].from = 0;
> + Â Â Â Â Â Â Â token = match_token(p, tokens, args);
> + Â Â Â Â Â Â Â switch (token) {
> + Â Â Â Â Â Â Â default:


This switch block reads odd...

> + Â Â Â Â Â Â Â Â Â Â Â pr_err("proc: unrecognized mount option \"%s\" "
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"or missing value", p);

"\n" is needed.

> + Â Â Â Â Â Â Â Â Â Â Â return 0;
> + Â Â Â Â Â Â Â }
> + Â Â Â }
> +
> + Â Â Â return 1;
> +}


Regards.
¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_