summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-08 14:39:48 +0200
committerJan Kara <jack@suse.cz>2017-08-17 18:52:48 +0200
commitbc8230ee8e2ba967af780cdaf2dcc0f8e5eb45ca (patch)
treee35a0236c766c6e9db88548fb8ff0dc7861119e2 /fs/ext4
parentaae4e7a8bc44722fe70d58920a36916b1043195e (diff)
quota: Convert dqio_mutex to rwsem
Convert dqio_mutex to rwsem and call it dqio_sem. No functional changes yet. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d61a70e2193a..4c168b90903c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5263,18 +5263,13 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
return 0;
}
-/* Helper function for writing quotas on sync - we need to start transaction
- * before quota file is locked for write. Otherwise the are possible deadlocks:
- * Process 1 Process 2
- * ext4_create() quota_sync()
- * jbd2_journal_start() write_dquot()
- * dquot_initialize() down(dqio_mutex)
- * down(dqio_mutex) jbd2_journal_start()
- *
- */
#ifdef CONFIG_QUOTA
+/*
+ * Helper functions so that transaction is started before we acquire dqio_sem
+ * to keep correct lock ordering of transaction > dqio_sem
+ */
static inline struct inode *dquot_to_inode(struct dquot *dquot)
{
return sb_dqopt(dquot->dq_sb)->files[dquot->dq_id.type];