summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-09-15 17:36:24 +0200
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-23 02:24:39 +0200
commitc05dbfc2609993ccc067879579e2a7726e12b3f1 (patch)
treed5b20ce06901a05b8649d31eb8694fef8f2dddb7 /fs/nilfs2/super.c
parentnilfs2: remove own inode allocator and destructor for metadata files (diff)
downloadlinux-c05dbfc2609993ccc067879579e2a7726e12b3f1.tar.xz
linux-c05dbfc2609993ccc067879579e2a7726e12b3f1.zip
nilfs2: accept 64-bit checkpoint numbers in cp mount option
The current implementation doesn't mount snapshots with checkpoint numbers larger than INT_MAX since it uses match_int() for parsing "cp=" mount option. This uses simple_strtoull() for the conversion to resolve the issue. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r--fs/nilfs2/super.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index d92ebd5d60d9..a1cd444103ff 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -556,7 +556,6 @@ static int parse_options(char *options, struct super_block *sb, int is_remount)
struct nilfs_sb_info *sbi = NILFS_SB(sb);
char *p;
substring_t args[MAX_OPT_ARGS];
- int option;
if (!options)
return 1;
@@ -594,8 +593,6 @@ static int parse_options(char *options, struct super_block *sb, int is_remount)
nilfs_write_opt(sbi, ERROR_MODE, ERRORS_CONT);
break;
case Opt_snapshot:
- if (match_int(&args[0], &option) || option <= 0)
- return 0;
if (is_remount) {
printk(KERN_ERR
"NILFS: \"%s\" option is invalid "
@@ -1065,7 +1062,7 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd)
{
char *p, *options = data;
substring_t args[MAX_OPT_ARGS];
- int option, token;
+ int token;
int ret = 0;
do {
@@ -1073,16 +1070,18 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd)
if (p != NULL && *p) {
token = match_token(p, tokens, args);
if (token == Opt_snapshot) {
- if (!(sd->flags & MS_RDONLY))
+ if (!(sd->flags & MS_RDONLY)) {
ret++;
- else {
- ret = match_int(&args[0], &option);
- if (!ret) {
- if (option > 0)
- sd->cno = option;
- else
- ret++;
- }
+ } else {
+ sd->cno = simple_strtoull(args[0].from,
+ NULL, 0);
+ /*
+ * No need to see the end pointer;
+ * match_token() has done syntax
+ * checking.
+ */
+ if (sd->cno == 0)
+ ret++;
}
}
if (ret)