mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-22 04:31:58 +08:00
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>
This commit is contained in:
parent
0414855fdc
commit
8c6915aef7
@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
|
|||||||
while ((p = strsep(&options, ",")) != NULL) {
|
while ((p = strsep(&options, ",")) != NULL) {
|
||||||
substring_t args[MAX_OPT_ARGS];
|
substring_t args[MAX_OPT_ARGS];
|
||||||
int token;
|
int token;
|
||||||
|
unsigned n;
|
||||||
if (!*p)
|
if (!*p)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
|
|||||||
case Opt_bs:
|
case Opt_bs:
|
||||||
if (match_int(&args[0], &option))
|
if (match_int(&args[0], &option))
|
||||||
return 0;
|
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);
|
uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
|
||||||
break;
|
break;
|
||||||
case Opt_unhide:
|
case Opt_unhide:
|
||||||
|
Loading…
Reference in New Issue
Block a user