From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Villemoes Subject: Re: [PATCH v2] devpts: allow mounting with uid/gid of uint32_t Date: Wed, 19 Aug 2015 10:34:43 +0200 Message-ID: <87io8b3cd8.fsf@rasmusvillemoes.dk> References: <882a878038efb5fed381be5d4817ff44d90703d5.1439904209.git.dpark@posteo.net> <692839ff7158dbb96dd20ce8e36c13f85fa64fd7.1439910753.git.dpark@posteo.net> <20150818164425.76b9df40f94bbd2a57d0d518@linux-foundation.org> <20150819072431.GA2642@posteo.de> <20150819004714.c06e4a70.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain Cc: Dongsu Park , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Peter Hurley , Josh Triplett , Al Viro , David Howells , Alban Crequy , Alexey Dobriyan To: Andrew Morton Return-path: Received: from mail-lb0-f173.google.com ([209.85.217.173]:33374 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbbHSIer (ORCPT ); Wed, 19 Aug 2015 04:34:47 -0400 Received: by lbbsx3 with SMTP id sx3so118978907lbb.0 for ; Wed, 19 Aug 2015 01:34:46 -0700 (PDT) In-Reply-To: <20150819004714.c06e4a70.akpm@linux-foundation.org> (Andrew Morton's message of "Wed, 19 Aug 2015 00:47:14 -0700") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Aug 19 2015, Andrew Morton 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. Rasmus