aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 735c20d5fd56..68a55dffb360 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1229,6 +1229,11 @@ static int parse_options(char *options, struct super_block *sb,
1229 if (!*p) 1229 if (!*p)
1230 continue; 1230 continue;
1231 1231
1232 /*
1233 * Initialize args struct so we know whether arg was
1234 * found; some options take optional arguments.
1235 */
1236 args[0].to = args[0].from = 0;
1232 token = match_token(p, tokens, args); 1237 token = match_token(p, tokens, args);
1233 switch (token) { 1238 switch (token) {
1234 case Opt_bsd_df: 1239 case Opt_bsd_df:
@@ -1518,10 +1523,11 @@ set_qf_format:
1518 clear_opt(sbi->s_mount_opt, BARRIER); 1523 clear_opt(sbi->s_mount_opt, BARRIER);
1519 break; 1524 break;
1520 case Opt_barrier: 1525 case Opt_barrier:
1521 if (match_int(&args[0], &option)) { 1526 if (args[0].from) {
1522 set_opt(sbi->s_mount_opt, BARRIER); 1527 if (match_int(&args[0], &option))
1523 break; 1528 return 0;
1524 } 1529 } else
1530 option = 1; /* No argument, default to 1 */
1525 if (option) 1531 if (option)
1526 set_opt(sbi->s_mount_opt, BARRIER); 1532 set_opt(sbi->s_mount_opt, BARRIER);
1527 else 1533 else
@@ -1594,10 +1600,11 @@ set_qf_format:
1594 set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); 1600 set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC);
1595 break; 1601 break;
1596 case Opt_auto_da_alloc: 1602 case Opt_auto_da_alloc:
1597 if (match_int(&args[0], &option)) { 1603 if (args[0].from) {
1598 clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); 1604 if (match_int(&args[0], &option))
1599 break; 1605 return 0;
1600 } 1606 } else
1607 option = 1; /* No argument, default to 1 */
1601 if (option) 1608 if (option)
1602 clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); 1609 clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC);
1603 else 1610 else