diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 52dd0679a4e2..686ebcc2e6c7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -979,7 +979,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
979 | int data_opt = 0; | 979 | int data_opt = 0; |
980 | int option; | 980 | int option; |
981 | #ifdef CONFIG_QUOTA | 981 | #ifdef CONFIG_QUOTA |
982 | int qtype; | 982 | int qtype, qfmt; |
983 | char *qname; | 983 | char *qname; |
984 | #endif | 984 | #endif |
985 | 985 | ||
@@ -1162,7 +1162,9 @@ static int parse_options (char *options, struct super_block *sb, | |||
1162 | case Opt_grpjquota: | 1162 | case Opt_grpjquota: |
1163 | qtype = GRPQUOTA; | 1163 | qtype = GRPQUOTA; |
1164 | set_qf_name: | 1164 | set_qf_name: |
1165 | if (sb_any_quota_enabled(sb)) { | 1165 | if ((sb_any_quota_enabled(sb) || |
1166 | sb_any_quota_suspended(sb)) && | ||
1167 | !sbi->s_qf_names[qtype]) { | ||
1166 | printk(KERN_ERR | 1168 | printk(KERN_ERR |
1167 | "EXT4-fs: Cannot change journalled " | 1169 | "EXT4-fs: Cannot change journalled " |
1168 | "quota options when quota turned on.\n"); | 1170 | "quota options when quota turned on.\n"); |
@@ -1200,7 +1202,9 @@ set_qf_name: | |||
1200 | case Opt_offgrpjquota: | 1202 | case Opt_offgrpjquota: |
1201 | qtype = GRPQUOTA; | 1203 | qtype = GRPQUOTA; |
1202 | clear_qf_name: | 1204 | clear_qf_name: |
1203 | if (sb_any_quota_enabled(sb)) { | 1205 | if ((sb_any_quota_enabled(sb) || |
1206 | sb_any_quota_suspended(sb)) && | ||
1207 | sbi->s_qf_names[qtype]) { | ||
1204 | printk(KERN_ERR "EXT4-fs: Cannot change " | 1208 | printk(KERN_ERR "EXT4-fs: Cannot change " |
1205 | "journalled quota options when " | 1209 | "journalled quota options when " |
1206 | "quota turned on.\n"); | 1210 | "quota turned on.\n"); |
@@ -1213,10 +1217,20 @@ clear_qf_name: | |||
1213 | sbi->s_qf_names[qtype] = NULL; | 1217 | sbi->s_qf_names[qtype] = NULL; |
1214 | break; | 1218 | break; |
1215 | case Opt_jqfmt_vfsold: | 1219 | case Opt_jqfmt_vfsold: |
1216 | sbi->s_jquota_fmt = QFMT_VFS_OLD; | 1220 | qfmt = QFMT_VFS_OLD; |
1217 | break; | 1221 | goto set_qf_format; |
1218 | case Opt_jqfmt_vfsv0: | 1222 | case Opt_jqfmt_vfsv0: |
1219 | sbi->s_jquota_fmt = QFMT_VFS_V0; | 1223 | qfmt = QFMT_VFS_V0; |
1224 | set_qf_format: | ||
1225 | if ((sb_any_quota_enabled(sb) || | ||
1226 | sb_any_quota_suspended(sb)) && | ||
1227 | sbi->s_jquota_fmt != qfmt) { | ||
1228 | printk(KERN_ERR "EXT4-fs: Cannot change " | ||
1229 | "journaled quota options when " | ||
1230 | "quota turned on.\n"); | ||
1231 | return 0; | ||
1232 | } | ||
1233 | sbi->s_jquota_fmt = qfmt; | ||
1220 | break; | 1234 | break; |
1221 | case Opt_quota: | 1235 | case Opt_quota: |
1222 | case Opt_usrquota: | 1236 | case Opt_usrquota: |