diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2010-08-01 17:48:36 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-08-01 17:48:36 -0400 |
commit | ca0e05e4b15193aeba72b995e90de990db7f8304 (patch) | |
tree | 85320333eb1832221225711a4b7bc0f970981c79 /fs/ext4 | |
parent | 437f88cc031ffe7f37f3e705367f4fe1f4be8b0f (diff) |
ext4: force block allocation on quota_off
Perform full sync procedure so that any delayed allocation blocks are
allocated so quota will be consistent.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 282a2704be23..3e3f6484c223 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1118,6 +1118,7 @@ static int ext4_mark_dquot_dirty(struct dquot *dquot); | |||
1118 | static int ext4_write_info(struct super_block *sb, int type); | 1118 | static int ext4_write_info(struct super_block *sb, int type); |
1119 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 1119 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
1120 | char *path); | 1120 | char *path); |
1121 | static int ext4_quota_off(struct super_block *sb, int type); | ||
1121 | static int ext4_quota_on_mount(struct super_block *sb, int type); | 1122 | static int ext4_quota_on_mount(struct super_block *sb, int type); |
1122 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, | 1123 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, |
1123 | size_t len, loff_t off); | 1124 | size_t len, loff_t off); |
@@ -1139,7 +1140,7 @@ static const struct dquot_operations ext4_quota_operations = { | |||
1139 | 1140 | ||
1140 | static const struct quotactl_ops ext4_qctl_operations = { | 1141 | static const struct quotactl_ops ext4_qctl_operations = { |
1141 | .quota_on = ext4_quota_on, | 1142 | .quota_on = ext4_quota_on, |
1142 | .quota_off = dquot_quota_off, | 1143 | .quota_off = ext4_quota_off, |
1143 | .quota_sync = dquot_quota_sync, | 1144 | .quota_sync = dquot_quota_sync, |
1144 | .get_info = dquot_get_dqinfo, | 1145 | .get_info = dquot_get_dqinfo, |
1145 | .set_info = dquot_set_dqinfo, | 1146 | .set_info = dquot_set_dqinfo, |
@@ -4098,6 +4099,18 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
4098 | return err; | 4099 | return err; |
4099 | } | 4100 | } |
4100 | 4101 | ||
4102 | static int ext4_quota_off(struct super_block *sb, int type) | ||
4103 | { | ||
4104 | /* Force all delayed allocation blocks to be allocated */ | ||
4105 | if (test_opt(sb, DELALLOC)) { | ||
4106 | down_read(&sb->s_umount); | ||
4107 | sync_filesystem(sb); | ||
4108 | up_read(&sb->s_umount); | ||
4109 | } | ||
4110 | |||
4111 | return dquot_quota_off(sb, type); | ||
4112 | } | ||
4113 | |||
4101 | /* Read data from quotafile - avoid pagecache and such because we cannot afford | 4114 | /* Read data from quotafile - avoid pagecache and such because we cannot afford |
4102 | * acquiring the locks... As quota files are never truncated and quota code | 4115 | * acquiring the locks... As quota files are never truncated and quota code |
4103 | * itself serializes the operations (and noone else should touch the files) | 4116 | * itself serializes the operations (and noone else should touch the files) |