summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2017-09-09 12:19:22 +0300
committerJan Kara <jack@suse.cz>2017-09-18 12:23:58 +0200
commit0a51fb7174f2b7866b4d7a4a5c23b685b674beb6 (patch)
tree8247a34b9678d343e2f1970f9221cd743154ec54 /fs
parent0666f560b71b899cd11a7caf39fd45129e9030fd (diff)
downloadop-kernel-dev-0a51fb7174f2b7866b4d7a4a5c23b685b674beb6.zip
op-kernel-dev-0a51fb7174f2b7866b4d7a4a5c23b685b674beb6.tar.gz
quota: add missing lock into __dquot_transfer()
Lock dq_dqb_lock around dquot_decr_inodes() Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Fixes: 7b9ca4c61bc2 ("quota: Reduce contention on dq_data_lock") Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/quota/dquot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 8381db9..50b0556 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -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;
}
}
OpenPOWER on IntegriCloud