From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Clayton Subject: Re: [PATCH] Fix number parsing in cifs_parse_mount_options Date: Fri, 13 Apr 2012 22:47:02 +0100 Message-ID: <4F889ED6.3040700@googlemail.com> References: <201204130712.51693.chris2553@googlemail.com> <1334322272.2308.1.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Linux CIFS mailing list , jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org, smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: Sachin Prabhu Return-path: In-Reply-To: <1334322272.2308.1.camel@localhost> Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On 04/13/12 14:04, Sachin Prabhu wrote: > The function kstrtoul() used to parse number strings in the mount > option parser is set to expect a base 10 number . This treats the octal > numbers passed for mount options such as file_mode as base10 numbers > leading to incorrect behavior. > > Change the 'base' argument passed to kstrtoul from 10 to 0 to > allow it to auto-detect the base of the number passed. > > Signed-off-by: Sachin Prabhu > Reported-by: Chris Clayton > > --- > fs/cifs/connect.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c > index 6a86f3d..f31dc9a 100644 > --- a/fs/cifs/connect.c > +++ b/fs/cifs/connect.c > @@ -1123,7 +1123,7 @@ static int get_option_ul(substring_t args[], unsigned long *option) > string = match_strdup(args); > if (string == NULL) > return -ENOMEM; > - rc = kstrtoul(string, 10, option); > + rc = kstrtoul(string, 0, option); > kfree(string); > > return rc; Yes, that's fixed it. Thanks again, Sachin. Tested-by: Chris Clayton