quota: Push dqio_sem down to ->release_dqblk()
[sfrench/cifs-2.6.git] / fs / quota / quota_v2.c
index 7a05b80f3b8ceb7c620f52f99a8b24fe2cf1c12d..8f54b159e4236c1cafdfa46985161324185bb59e 100644 (file)
@@ -322,7 +322,14 @@ static int v2_write_dquot(struct dquot *dquot)
 
 static int v2_release_dquot(struct dquot *dquot)
 {
-       return qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
+       struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
+       int ret;
+
+       down_write(&dqopt->dqio_sem);
+       ret = qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
+       up_write(&dqopt->dqio_sem);
+
+       return ret;
 }
 
 static int v2_free_file_info(struct super_block *sb, int type)