aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-09-15 11:36:24 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-22 20:24:39 -0400
commitc05dbfc2609993ccc067879579e2a7726e12b3f1 (patch)
treed5b20ce06901a05b8649d31eb8694fef8f2dddb7 /fs/nilfs2/super.c
parent2879ed66e4c6da1dfc6bb0bd04566b61824f9256 (diff)
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)
556 struct nilfs_sb_info *sbi = NILFS_SB(sb); 556 struct nilfs_sb_info *sbi = NILFS_SB(sb);
557 char *p; 557 char *p;
558 substring_t args[MAX_OPT_ARGS]; 558 substring_t args[MAX_OPT_ARGS];
559 int option;
560 559
561 if (!options) 560 if (!options)
562 return 1; 561 return 1;
@@ -594,8 +593,6 @@ static int parse_options(char *options, struct super_block *sb, int is_remount)
594 nilfs_write_opt(sbi, ERROR_MODE, ERRORS_CONT); 593 nilfs_write_opt(sbi, ERROR_MODE, ERRORS_CONT);
595 break; 594 break;
596 case Opt_snapshot: 595 case Opt_snapshot:
597 if (match_int(&args[0], &option) || option <= 0)
598 return 0;
599 if (is_remount) { 596 if (is_remount) {
600 printk(KERN_ERR 597 printk(KERN_ERR
601 "NILFS: \"%s\" option is invalid " 598 "NILFS: \"%s\" option is invalid "
@@ -1065,7 +1062,7 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd)
1065{ 1062{
1066 char *p, *options = data; 1063 char *p, *options = data;
1067 substring_t args[MAX_OPT_ARGS]; 1064 substring_t args[MAX_OPT_ARGS];
1068 int option, token; 1065 int token;
1069 int ret = 0; 1066 int ret = 0;
1070 1067
1071 do { 1068 do {
@@ -1073,16 +1070,18 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd)
1073 if (p != NULL && *p) { 1070 if (p != NULL && *p) {
1074 token = match_token(p, tokens, args); 1071 token = match_token(p, tokens, args);
1075 if (token == Opt_snapshot) { 1072 if (token == Opt_snapshot) {
1076 if (!(sd->flags & MS_RDONLY)) 1073 if (!(sd->flags & MS_RDONLY)) {
1077 ret++; 1074 ret++;
1078 else { 1075 } else {
1079 ret = match_int(&args[0], &option); 1076 sd->cno = simple_strtoull(args[0].from,
1080 if (!ret) { 1077 NULL, 0);
1081 if (option > 0) 1078 /*
1082 sd->cno = option; 1079 * No need to see the end pointer;
1083 else 1080 * match_token() has done syntax
1084 ret++; 1081 * checking.
1085 } 1082 */
1083 if (sd->cno == 0)
1084 ret++;
1086 } 1085 }
1087 } 1086 }
1088 if (ret) 1087 if (ret)