linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hugetlbfs: return negative error code for bad mount option
@ 2009-04-13  3:56 Akinobu Mita
  2009-04-15 21:59 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Akinobu Mita @ 2009-04-13  3:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: William Irwin, linux-mm, linux-fsdevel, stable

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>

Cc: William Irwin <wli@holomorphy.com>
Cc: stable@kernel.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 23a3c76..153d968 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hugetlbfs: return negative error code for bad mount option
  2009-04-13  3:56 [PATCH] hugetlbfs: return negative error code for bad mount option Akinobu Mita
@ 2009-04-15 21:59 ` Andrew Morton
  2009-04-16  5:01   ` Akinobu Mita
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-04-15 21:59 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, wli, linux-mm, linux-fsdevel, stable

On Mon, 13 Apr 2009 12:56:23 +0900
Akinobu Mita <akinobu.mita@gmail.com> 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()?

> 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>
> ---
> 
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 23a3c76..153d968 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hugetlbfs: return negative error code for bad mount option
  2009-04-15 21:59 ` Andrew Morton
@ 2009-04-16  5:01   ` Akinobu Mita
  0 siblings, 0 replies; 3+ messages in thread
From: Akinobu Mita @ 2009-04-16  5:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, wli, linux-mm, linux-fsdevel, stable

On Wed, Apr 15, 2009 at 02:59:10PM -0700, Andrew Morton wrote:
> On Mon, 13 Apr 2009 12:56:23 +0900
> Akinobu Mita <akinobu.mita@gmail.com> 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.

Oh, sorry.

> 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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-16  5:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13  3:56 [PATCH] hugetlbfs: return negative error code for bad mount option Akinobu Mita
2009-04-15 21:59 ` Andrew Morton
2009-04-16  5:01   ` Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).