Skip to content

Commit

Permalink
quota: add missing lock into __dquot_transfer()
Browse files Browse the repository at this point in the history
Lock dq_dqb_lock around dquot_decr_inodes()

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Fixes: 7b9ca4c ("quota: Reduce contention on dq_data_lock")
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
koct9i authored and jankara committed Sep 18, 2017
1 parent 0666f56 commit 0a51fb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,9 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0,
&warn_to[cnt]);
if (ret) {
spin_lock(&transfer_to[cnt]->dq_dqb_lock);
dquot_decr_inodes(transfer_to[cnt], inode_usage);
spin_unlock(&transfer_to[cnt]->dq_dqb_lock);
goto over_quota;
}
}
Expand Down

0 comments on commit 0a51fb7

Please sign in to comment.