Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hugetlbfs: return negative error code for bad mount option

This fixes the following BUG:

# mount -o size=MM -t hugetlbfs none /huge
hugetlbfs: Bad value 'MM' for mount option 'size=MM'
------------[ cut here ]------------
kernel BUG at fs/super.c:996!

Due to

BUG_ON(!mnt->mnt_sb);

in vfs_kern_mount().

Also, remove unused #include <linux/quotaops.h>

Cc: William Irwin <wli@holomorphy.com>
Cc: <stable@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Akinobu Mita and committed by
Linus Torvalds
c12ddba0 4dec302f

+1 -2
+1 -2
fs/hugetlbfs/inode.c
··· 26 26 #include <linux/pagevec.h> 27 27 #include <linux/parser.h> 28 28 #include <linux/mman.h> 29 - #include <linux/quotaops.h> 30 29 #include <linux/slab.h> 31 30 #include <linux/dnotify.h> 32 31 #include <linux/statfs.h> ··· 841 842 bad_val: 842 843 printk(KERN_ERR "hugetlbfs: Bad value '%s' for mount option '%s'\n", 843 844 args[0].from, p); 844 - return 1; 845 + return -EINVAL; 845 846 } 846 847 847 848 static int