From 8c6915aef70dc4633d8aec4bc3b4f6fb34e88063 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Wed, 29 Jan 2014 17:13:16 +0800 Subject: fs: udf: parse_options: blocksize check Both affs and isofs check for blocksize integrity during parse_options.Do the same thing for udf. Valid values : 512, 1024, 2048 or 4096 bytes. Signed-off-by: Fabian Frederick Signed-off-by: Jan Kara --- fs/udf/super.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index 3306b9f..ac76538 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt, while ((p = strsep(&options, ",")) != NULL) { substring_t args[MAX_OPT_ARGS]; int token; + unsigned n; if (!*p) continue; @@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt, case Opt_bs: if (match_int(&args[0], &option)) return 0; - uopt->blocksize = option; + n = option; + if (n != 512 && n != 1024 && n != 2048 && n != 4096) + return 0; + uopt->blocksize = n; uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET); break; case Opt_unhide: -- cgit v1.1 From 53ea18de2ae3b82d4ac300e63bd864965f16b033 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Sat, 1 Feb 2014 15:45:18 +0800 Subject: udf: Add __init macro to init_inodecache init_inodecache is only called by __init init_udf_fs. Signed-off-by: Fabian Frederick Signed-off-by: Jan Kara --- fs/udf/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index ac76538..f15d2dc 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -175,7 +175,7 @@ static void init_once(void *foo) inode_init_once(&ei->vfs_inode); } -static int init_inodecache(void) +static int __init init_inodecache(void) { udf_inode_cachep = kmem_cache_create("udf_inode_cache", sizeof(struct udf_inode_info), -- cgit v1.1