From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akinobu Mita Subject: [PATCH] hugetlbfs: return negative error code for bad mount option Date: Mon, 13 Apr 2009 12:56:23 +0900 Message-ID: <20090413035623.GA4156@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: William Irwin , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, stable@kernel.org To: linux-kernel@vger.kernel.org Return-path: Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org 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 Cc: William Irwin Cc: stable@kernel.org Signed-off-by: Akinobu Mita --- 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 #include #include -#include #include #include #include @@ -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: email@kvack.org