From 6f80dfe55fcbde1e588bc2cfa1273403b710872d Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 7 Nov 2010 23:01:17 +0100 Subject: hfsplus: fix option parsing during remount hfsplus only actually uses the force option during remount, but it uses the full option parser with a fake superblock to do so. This means remount will fail if any nls option is set (which happens frequently with older mount tools), even if it is the same. Fix this by adding a simpler version of the parser that only parses the force option for remount. Signed-off-by: Christoph Hellwig --- fs/hfsplus/options.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'fs/hfsplus/options.c') diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c index f9ab276a4d8d..43b02b5525eb 100644 --- a/fs/hfsplus/options.c +++ b/fs/hfsplus/options.c @@ -65,6 +65,32 @@ static inline int match_fourchar(substring_t *arg, u32 *result) return 0; } +int hfsplus_parse_options_remount(char *input, int *force) +{ + char *p; + substring_t args[MAX_OPT_ARGS]; + int token; + + if (!input) + return 0; + + while ((p = strsep(&input, ",")) != NULL) { + if (!*p) + continue; + + token = match_token(p, tokens, args); + switch (token) { + case opt_force: + *force = 1; + break; + default: + break; + } + } + + return 1; +} + /* Parse options from mount. Returns 0 on failure */ /* input is the options passed to mount() as a string */ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) -- cgit v1.2.1