aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-07-03 10:45:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 15:58:34 -0400
commita1177825719ccef3f76ef39bbfd5ebb6087d53c7 (patch)
treeeb7a1137ea6438be224052f17c104cd040a10366 /fs/ext4/super.c
parentceed17236a7491b44ee2be21f56a41ab997cbe7d (diff)
quota: Move quota syncing to ->sync_fs method
Since the moment writes to quota files are using block device page cache and space for quota structures is reserved at the moment they are first accessed we have no reason to sync quota before inode writeback. In fact this order is now only harmful since quota information can easily change during inode writeback (either because conversion of delayed-allocated extents or simply because of allocation of new blocks for simple filesystems not using page_mkwrite). So move syncing of quota information after writeback of inodes into ->sync_fs method. This way we do not have to use ->quota_sync callback which is primarily intended for use by quotactl syscall anyway and we get rid of calling ->sync_fs() twice unnecessarily. We skip quota syncing for OCFS2 since it does proper quota journalling in all cases (unlike ext3, ext4, and reiserfs which also support legacy non-journalled quotas) and thus there are no dirty quota structures. CC: "Theodore Ts'o" <tytso@mit.edu> CC: Joel Becker <jlbec@evilplan.org> CC: reiserfs-devel@vger.kernel.org Acked-by: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Dave Kleikamp <shaggy@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index eb7aa3e4ef05..d8759401ecae 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)
4325 4325
4326 trace_ext4_sync_fs(sb, wait); 4326 trace_ext4_sync_fs(sb, wait);
4327 flush_workqueue(sbi->dio_unwritten_wq); 4327 flush_workqueue(sbi->dio_unwritten_wq);
4328 /*
4329 * Writeback quota in non-journalled quota case - journalled quota has
4330 * no dirty dquots
4331 */
4332 dquot_writeback_dquots(sb, -1);
4328 if (jbd2_journal_start_commit(sbi->s_journal, &target)) { 4333 if (jbd2_journal_start_commit(sbi->s_journal, &target)) {
4329 if (wait) 4334 if (wait)
4330 jbd2_log_wait_commit(sbi->s_journal, target); 4335 jbd2_log_wait_commit(sbi->s_journal, target);