Skip to contentSkip to conversation

hugetlbfs: return negative error code for bad mount option

PATCH In review Akinobu Mita 2 participants 3 messages Apr 13, 2009 – Apr 16, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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!

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

---

fs/hugetlbfs/inode.c +1 -2
index 23a3c76..153d968 100644
@@ -26,7 +26,6 @@
 #include <linux/pagevec.h>
 #include <linux/parser.h>
 #include <linux/mman.h>
-#include <linux/quotaops.h>
 #include <linux/slab.h>
 #include <linux/dnotify.h>
 #include <linux/statfs.h>
@@ -842,7 +841,7 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
 bad_val:
  	printk(KERN_ERR "hugetlbfs: Bad value '%s' for mount option '%s'\n",
 	       args[0].from, p);
- 	return 1;
+ 	return -EINVAL;
 }
 
 static int

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#1 lore raw
Quoted 6 lines · On Mon, 13 Apr 2009 12:56:23 +0900 Akinobu Mita <[email protected]> wrote:

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!

I can't tell where this BUG (or WARN?) is happening unless I know exactly which kernel version was tested.

I assume that it is BUG_ON(!mnt->mnt_sb); in vfs_kern_mount()?

Quoted 20 lines

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

---

fs/hugetlbfs/inode.c +0 -1
index 23a3c76..153d968 100644
@@ -26,7 +26,6 @@
 #include <linux/pagevec.h>
 #include <linux/parser.h>
 #include <linux/mman.h>
-#include <linux/quotaops.h>
 #include <linux/slab.h>
 #include <linux/dnotify.h>
 #include <linux/statfs.h>

fs/hugetlbfs/inode.c hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig) · line 847

Quoted 8 lines
fs/hugetlbfs/inode.c +1 -1
@@ -842,7 +841,7 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
 bad_val:
  	printk(KERN_ERR "hugetlbfs: Bad value '%s' for mount option '%s'\n",
 	       args[0].from, p);
- 	return 1;
+ 	return -EINVAL;
 }
 
 static int

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 2 lines · On Mon, 13 Apr 2009 12:56:23 +0900 Akinobu Mita <[email protected]> wrote:

This fixes the following BUG:

Quoted 7 lines
Quoted 4 lines
# 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!

I can't tell where this BUG (or WARN?) is happening unless I know exactly which kernel version was tested.

Oh, sorry.

Quoted 1 line

I assume that it is BUG_ON(!mnt->mnt_sb); in vfs_kern_mount()?

Yes. In vfs_kern_mount(), type->get_sb() returns 1 then BUG_ON(!mnt->mnt_sb);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>