Re: [PATCH v2] devpts: allow mounting with uid/gid of uint32_t

From: Rasmus Villemoes
Date: Wed Aug 19 2015 - 04:34:55 EST


On Wed, Aug 19 2015, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

>
> whoa, wait, I was looking at the -mm tree which changes kstrtouint():
>
> static inline int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res)
> {
> return parse_integer(s, base | PARSE_INTEGER_NEWLINE, res);
> }
>
> and
>
> * Return number of characters parsed or -E.
> ...
> */
> #define parse_integer(s, base, val) \
>
>
> Alexey, doesn't this mean that code which does
>
> if (kstrtouint(...))
> return -EFOO;
>
> will break?

No, because PARSE_INTEGER_NEWLINE means more than just accepting a
trailing newline. It also requires the entire string to be consumed, and
changes the return semantics.

I suggested splitting those three things into separate flags and letting
PARSE_INTEGER_KSTRTOX be a shorthand for those.

<http://thread.gmane.org/gmane.linux.kernel/1949066/focus=1949239>

Rasmus
--
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/