diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 711b801fbcdf215f76ff40c9fbcfed9d893c36fa..d145cb79c30a4dd3caea5f328737e3418e96548f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -621,6 +621,8 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig) while ((p = strsep(&options, ",")) != NULL) { int token; + if (!*p) + continue; token = match_token(p, tokens, args); switch (token) { @@ -665,8 +667,9 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig) break; default: - printk(KERN_ERR "hugetlbfs: Bad mount option: %s\n", p); - return 1; + printk(KERN_ERR "hugetlbfs: Bad mount option: \"%s\"\n", + p); + return -EINVAL; break; } } @@ -693,7 +696,6 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent) config.gid = current->fsgid; config.mode = 0755; ret = hugetlbfs_parse_options(data, &config); - if (ret) return ret; diff --git a/fs/super.c b/fs/super.c index 5260d620c555fbd987eed1642649c0372670ace9..fc8ebedc6bed1aa901e24ebf8e34fd397cc6361e 100644 --- a/fs/super.c +++ b/fs/super.c @@ -884,6 +884,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void error = type->get_sb(type, flags, name, data, mnt); if (error < 0) goto out_free_secdata; + BUG_ON(!mnt->mnt_sb); error = security_sb_kern_mount(mnt->mnt_sb, secdata); if (error)