From 498719f82ce9bbabf2c679f7c47a1aa055f8b989 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Sun, 1 Aug 2010 17:48:36 -0400 Subject: [PATCH] --- yaml --- r: 206319 b: refs/heads/master c: ca0e05e4b15193aeba72b995e90de990db7f8304 h: refs/heads/master i: 206317: 67acc22309cdbe95b194d3538552a2f5643cf5ee 206315: 64189ee9dcb306ca518eb503950e46023d3d85fb 206311: bce91360d23f05a10b708c070c89383b382816b8 206303: dc639c1588c56b37cc204a0b1f25f2b81e2f95ac v: v3 --- [refs] | 2 +- trunk/fs/ext4/super.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 3f769f8845a8..e40cf3033576 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 437f88cc031ffe7f37f3e705367f4fe1f4be8b0f +refs/heads/master: ca0e05e4b15193aeba72b995e90de990db7f8304 diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index 282a2704be23..3e3f6484c223 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -1118,6 +1118,7 @@ static int ext4_mark_dquot_dirty(struct dquot *dquot); static int ext4_write_info(struct super_block *sb, int type); static int ext4_quota_on(struct super_block *sb, int type, int format_id, char *path); +static int ext4_quota_off(struct super_block *sb, int type); static int ext4_quota_on_mount(struct super_block *sb, int type); static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off); @@ -1139,7 +1140,7 @@ static const struct dquot_operations ext4_quota_operations = { static const struct quotactl_ops ext4_qctl_operations = { .quota_on = ext4_quota_on, - .quota_off = dquot_quota_off, + .quota_off = ext4_quota_off, .quota_sync = dquot_quota_sync, .get_info = dquot_get_dqinfo, .set_info = dquot_set_dqinfo, @@ -4098,6 +4099,18 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, return err; } +static int ext4_quota_off(struct super_block *sb, int type) +{ + /* Force all delayed allocation blocks to be allocated */ + if (test_opt(sb, DELALLOC)) { + down_read(&sb->s_umount); + sync_filesystem(sb); + up_read(&sb->s_umount); + } + + return dquot_quota_off(sb, type); +} + /* Read data from quotafile - avoid pagecache and such because we cannot afford * acquiring the locks... As quota files are never truncated and quota code * itself serializes the operations (and noone else should touch the files)