aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-01-29 04:13:16 -0500
committerJan Kara <jack@suse.cz>2014-03-03 05:30:57 -0500
commit8c6915aef70dc4633d8aec4bc3b4f6fb34e88063 (patch)
tree21dfb39726ccd03693453814c889f19ed2e1bb15
parent0414855fdc4a40da05221fc6062cccbc0c30f169 (diff)
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 <fabf@skynet.be> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 3306b9f69bed..ac765386004e 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,
505 while ((p = strsep(&options, ",")) != NULL) { 505 while ((p = strsep(&options, ",")) != NULL) {
506 substring_t args[MAX_OPT_ARGS]; 506 substring_t args[MAX_OPT_ARGS];
507 int token; 507 int token;
508 unsigned n;
508 if (!*p) 509 if (!*p)
509 continue; 510 continue;
510 511
@@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
516 case Opt_bs: 517 case Opt_bs:
517 if (match_int(&args[0], &option)) 518 if (match_int(&args[0], &option))
518 return 0; 519 return 0;
519 uopt->blocksize = option; 520 n = option;
521 if (n != 512 && n != 1024 && n != 2048 && n != 4096)
522 return 0;
523 uopt->blocksize = n;
520 uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET); 524 uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
521 break; 525 break;
522 case Opt_unhide: 526 case Opt_unhide: