diff mbox series

[15/15] hugetlbfs: fix mount mode command line processing

Message ID 20210723225044.DpiHGbzxj%akpm@linux-foundation.org
State New
Headers show
Series [01/15] userfaultfd: do not untag user pointers | expand

Commit Message

Andrew Morton July 23, 2021, 10:50 p.m. UTC
From: Mike Kravetz <mike.kravetz@oracle.com>
Subject: hugetlbfs: fix mount mode command line processing

In commit 32021982a324 ("hugetlbfs: Convert to fs_context") processing of
the mount mode string was changed from match_octal() to fsparam_u32.  This
changed existing behavior as match_octal does not require octal values to
have a '0' prefix, but fsparam_u32 does.

Use fsparam_u32oct which provides the same behavior as match_octal.

Link: https://lkml.kernel.org/r/20210721183326.102716-1-mike.kravetz@oracle.com
Fixes: 32021982a324 ("hugetlbfs: Convert to fs_context")
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reported-by: Dennis Camera <bugs+kernel.org@dtnr.ch>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/hugetlbfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Al Viro July 24, 2021, 1:41 a.m. UTC | #1
On Fri, Jul 23, 2021 at 03:50:44PM -0700, Andrew Morton wrote:
> From: Mike Kravetz <mike.kravetz@oracle.com>

> Subject: hugetlbfs: fix mount mode command line processing

> 

> In commit 32021982a324 ("hugetlbfs: Convert to fs_context") processing of

> the mount mode string was changed from match_octal() to fsparam_u32.  This

> changed existing behavior as match_octal does not require octal values to

> have a '0' prefix, but fsparam_u32 does.

> 

> Use fsparam_u32oct which provides the same behavior as match_octal.


Looks sane...  Which tree do you want it to go through?
Andrew Morton July 26, 2021, 5:22 a.m. UTC | #2
On Sat, 24 Jul 2021 01:41:52 +0000 Al Viro <viro@zeniv.linux.org.uk> wrote:

> On Fri, Jul 23, 2021 at 03:50:44PM -0700, Andrew Morton wrote:

> > From: Mike Kravetz <mike.kravetz@oracle.com>

> > Subject: hugetlbfs: fix mount mode command line processing

> > 

> > In commit 32021982a324 ("hugetlbfs: Convert to fs_context") processing of

> > the mount mode string was changed from match_octal() to fsparam_u32.  This

> > changed existing behavior as match_octal does not require octal values to

> > have a '0' prefix, but fsparam_u32 does.

> > 

> > Use fsparam_u32oct which provides the same behavior as match_octal.

> 

> Looks sane...  Which tree do you want it to go through?


It's now in mainline, with cc:stable, Fixes: 32021982a324.
diff mbox series

Patch

--- a/fs/hugetlbfs/inode.c~hugetlbfs-fix-mount-mode-command-line-processing
+++ a/fs/hugetlbfs/inode.c
@@ -77,7 +77,7 @@  enum hugetlb_param {
 static const struct fs_parameter_spec hugetlb_fs_parameters[] = {
 	fsparam_u32   ("gid",		Opt_gid),
 	fsparam_string("min_size",	Opt_min_size),
-	fsparam_u32   ("mode",		Opt_mode),
+	fsparam_u32oct("mode",		Opt_mode),
 	fsparam_string("nr_inodes",	Opt_nr_inodes),
 	fsparam_string("pagesize",	Opt_pagesize),
 	fsparam_string("size",		Opt_size),