From 198297df4ea39d4fd3b304178a985c50eb54cd04 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 15 Feb 2010 20:17:55 -0500 Subject: [PATCH] --- yaml --- r: 185851 b: refs/heads/master c: 15121c18a22ae483279f76dc9e554334b800d0f7 h: refs/heads/master i: 185849: 992fb60d4f78c717a096043e99eeecfd178d0fad 185847: 5895647e92128f889720c422420a46156b341ce1 v: v3 --- [refs] | 2 +- trunk/fs/ext4/super.c | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 6ea0da70c999..919192b0d955 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1de02dccf906faba2ee2d99cac56799bda3b96a +refs/heads/master: 15121c18a22ae483279f76dc9e554334b800d0f7 diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index 735c20d5fd56..68a55dffb360 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -1229,6 +1229,11 @@ static int parse_options(char *options, struct super_block *sb, if (!*p) continue; + /* + * Initialize args struct so we know whether arg was + * found; some options take optional arguments. + */ + args[0].to = args[0].from = 0; token = match_token(p, tokens, args); switch (token) { case Opt_bsd_df: @@ -1518,10 +1523,11 @@ static int parse_options(char *options, struct super_block *sb, clear_opt(sbi->s_mount_opt, BARRIER); break; case Opt_barrier: - if (match_int(&args[0], &option)) { - set_opt(sbi->s_mount_opt, BARRIER); - break; - } + if (args[0].from) { + if (match_int(&args[0], &option)) + return 0; + } else + option = 1; /* No argument, default to 1 */ if (option) set_opt(sbi->s_mount_opt, BARRIER); else @@ -1594,10 +1600,11 @@ static int parse_options(char *options, struct super_block *sb, set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); break; case Opt_auto_da_alloc: - if (match_int(&args[0], &option)) { - clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); - break; - } + if (args[0].from) { + if (match_int(&args[0], &option)) + return 0; + } else + option = 1; /* No argument, default to 1 */ if (option) clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); else