->quota_sync
Hi Jan,
is there any reason the ->quota_sync operations (which always ends up in dquot_quota_sync, or gfs2_quota_sync) is called before writing back the inodes? Given that writeback can perform allocations in filesystem not using ->page_mkwrite or at least cause delalloc conversions that seems like the wrong place to me. Even more so fixing the placement means we could just call dquot_quota_sync from ->sync_fs, similar how XFS does it's quota writeout, and thus avoiding the duplicate call to ->sync_fs from inside dquot_quota_sync, as well as getting rid of the abuse of the quotactl ops from VFS code.
Jan Kara
reviewerHi,
Quoted 3 lines · Christoph Hellwig
is there any reason the ->quota_sync operations (which always ends up in
dquot_quota_sync, orgfs2_quota_sync) is called before writing back the inodes?
Hmm, historically, there was a reason because writing of quota entries
might have needed to allocate new blocks to quota file. But these days I don't see any reason since we allocate necessary blocks when quota entry is first looked up and directly modify block device pages when it is modified.
Quoted 3 lines
Given that writeback can perform allocations in filesystem not using ->page_mkwrite or at least cause delalloc conversions that seems like the wrong place to me.
Yes, doing quota writeout after inode writeout would be a more logical
place.
Quoted 5 lines
Even more so fixing the placement means
we could just calldquot_quota_syncfrom ->sync_fs, similar how XFS does it's quota writeout, and thus avoiding the duplicate call to ->sync_fs from insidedquot_quota_sync, as well as getting rid of the abuse of the quotactl ops from VFS code.
True. I'll add these changes to my patches cleaning up sync code.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR