diff --git a/fs/ext2/super.c b/fs/ext2/super.c index b3621cb7ea31d6959943c7a2ec37e7ae2b362293..5df3d2d8169c25c1af4f45ce77a5f062517049de 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1184,6 +1184,12 @@ static int ext2_sync_fs(struct super_block *sb, int wait) struct ext2_sb_info *sbi = EXT2_SB(sb); struct ext2_super_block *es = EXT2_SB(sb)->s_es; + /* + * Write quota structures to quota file, sync_blockdev() will write + * them to disk later + */ + dquot_writeback_dquots(sb, -1); + spin_lock(&sbi->s_lock); if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) { ext2_debug("setting valid to 0\n"); diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 8c3a44b7c375247f54ac0d0e61be3be99e0b1d6a..4ac304c55c5327703e19ed990c39a67460f1c4ad 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -2526,6 +2526,11 @@ static int ext3_sync_fs(struct super_block *sb, int wait) tid_t target; trace_ext3_sync_fs(sb, wait); + /* + * Writeback quota in non-journalled quota case - journalled quota has + * no dirty dquots + */ + dquot_writeback_dquots(sb, -1); if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) { if (wait) log_wait_commit(EXT3_SB(sb)->s_journal, target); diff --git a/fs/ext4/super.c b/fs/ext4/super.c index eb7aa3e4ef05caf136f24e0565a28e6d1e0a1539..d8759401ecae835f696b8f648f4d2ff9883da8c9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4325,6 +4325,11 @@ static int ext4_sync_fs(struct super_block *sb, int wait) trace_ext4_sync_fs(sb, wait); flush_workqueue(sbi->dio_unwritten_wq); + /* + * Writeback quota in non-journalled quota case - journalled quota has + * no dirty dquots + */ + dquot_writeback_dquots(sb, -1); if (jbd2_journal_start_commit(sbi->s_journal, &target)) { if (wait) jbd2_log_wait_commit(sbi->s_journal, target); diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 313c329490e2150498239f23ff5578cfb27f4c42..f3d6bbfb32c5308e9893fe6c689bf1935af2bc50 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -952,6 +952,8 @@ static void gfs2_put_super(struct super_block *sb) static int gfs2_sync_fs(struct super_block *sb, int wait) { struct gfs2_sbd *sdp = sb->s_fs_info; + + gfs2_quota_sync(sb, -1); if (wait && sdp) gfs2_log_flush(sdp, NULL); return 0; diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 4a82950f412f8c274007f574e91b9ee59766061a..c55c7452d2857c1f0f59042f5b6ffd1de9eba8b6 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -601,6 +601,11 @@ static int jfs_sync_fs(struct super_block *sb, int wait) /* log == NULL indicates read-only mount */ if (log) { + /* + * Write quota structures to quota file, sync_blockdev() will + * write them to disk later + */ + dquot_writeback_dquots(sb, -1); jfs_flush_journal(log, wait); jfs_syncpt(log, 0); } diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 651ce767b55d8241e283b3001d7fc9e6d803b317..7a37dabf5a968b7c8977c2028665f58554987912 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -68,6 +68,11 @@ static int reiserfs_sync_fs(struct super_block *s, int wait) { struct reiserfs_transaction_handle th; + /* + * Writeback quota in non-journalled quota case - journalled quota has + * no dirty dquots + */ + dquot_writeback_dquots(s, -1); reiserfs_write_lock(s); if (!journal_begin(&th, s, 1)) if (!journal_end_sync(&th, s, 1)) diff --git a/fs/sync.c b/fs/sync.c index cae145dd801818975e1454594be4276fe953a857..66acd2ba91c4095244d50b87a1a7b5cdcd9175d2 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -29,9 +29,6 @@ */ static int __sync_filesystem(struct super_block *sb, int wait) { - if (sb->s_qcop && sb->s_qcop->quota_sync) - sb->s_qcop->quota_sync(sb, -1); - if (wait) sync_inodes_sb(sb); else