diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
commit | f1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch) | |
tree | c2c130a74be25b0b2dff992e1a195e2728bdaadd /fs/ext2/super.c | |
parent | fd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 71e9eb1fa696..7ff43f4a59cd 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -119,6 +119,8 @@ static void ext2_put_super (struct super_block * sb) | |||
119 | int i; | 119 | int i; |
120 | struct ext2_sb_info *sbi = EXT2_SB(sb); | 120 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
121 | 121 | ||
122 | dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | ||
123 | |||
122 | if (sb->s_dirt) | 124 | if (sb->s_dirt) |
123 | ext2_write_super(sb); | 125 | ext2_write_super(sb); |
124 | 126 | ||
@@ -1063,6 +1065,12 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
1063 | sb->s_op = &ext2_sops; | 1065 | sb->s_op = &ext2_sops; |
1064 | sb->s_export_op = &ext2_export_ops; | 1066 | sb->s_export_op = &ext2_export_ops; |
1065 | sb->s_xattr = ext2_xattr_handlers; | 1067 | sb->s_xattr = ext2_xattr_handlers; |
1068 | |||
1069 | #ifdef CONFIG_QUOTA | ||
1070 | sb->dq_op = &dquot_operations; | ||
1071 | sb->s_qcop = &dquot_quotactl_ops; | ||
1072 | #endif | ||
1073 | |||
1066 | root = ext2_iget(sb, EXT2_ROOT_INO); | 1074 | root = ext2_iget(sb, EXT2_ROOT_INO); |
1067 | if (IS_ERR(root)) { | 1075 | if (IS_ERR(root)) { |
1068 | ret = PTR_ERR(root); | 1076 | ret = PTR_ERR(root); |
@@ -1241,6 +1249,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1241 | spin_unlock(&sbi->s_lock); | 1249 | spin_unlock(&sbi->s_lock); |
1242 | return 0; | 1250 | return 0; |
1243 | } | 1251 | } |
1252 | |||
1244 | /* | 1253 | /* |
1245 | * OK, we are remounting a valid rw partition rdonly, so set | 1254 | * OK, we are remounting a valid rw partition rdonly, so set |
1246 | * the rdonly flag and then mark the partition as valid again. | 1255 | * the rdonly flag and then mark the partition as valid again. |
@@ -1248,6 +1257,13 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1248 | es->s_state = cpu_to_le16(sbi->s_mount_state); | 1257 | es->s_state = cpu_to_le16(sbi->s_mount_state); |
1249 | es->s_mtime = cpu_to_le32(get_seconds()); | 1258 | es->s_mtime = cpu_to_le32(get_seconds()); |
1250 | spin_unlock(&sbi->s_lock); | 1259 | spin_unlock(&sbi->s_lock); |
1260 | |||
1261 | err = dquot_suspend(sb, -1); | ||
1262 | if (err < 0) { | ||
1263 | spin_lock(&sbi->s_lock); | ||
1264 | goto restore_opts; | ||
1265 | } | ||
1266 | |||
1251 | ext2_sync_super(sb, es, 1); | 1267 | ext2_sync_super(sb, es, 1); |
1252 | } else { | 1268 | } else { |
1253 | __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, | 1269 | __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, |
@@ -1269,8 +1285,12 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1269 | if (!ext2_setup_super (sb, es, 0)) | 1285 | if (!ext2_setup_super (sb, es, 0)) |
1270 | sb->s_flags &= ~MS_RDONLY; | 1286 | sb->s_flags &= ~MS_RDONLY; |
1271 | spin_unlock(&sbi->s_lock); | 1287 | spin_unlock(&sbi->s_lock); |
1288 | |||
1272 | ext2_write_super(sb); | 1289 | ext2_write_super(sb); |
1290 | |||
1291 | dquot_resume(sb, -1); | ||
1273 | } | 1292 | } |
1293 | |||
1274 | return 0; | 1294 | return 0; |
1275 | restore_opts: | 1295 | restore_opts: |
1276 | sbi->s_mount_opt = old_opts.s_mount_opt; | 1296 | sbi->s_mount_opt = old_opts.s_mount_opt; |