mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] quota: add missing lock into __dquot_transfer()
@ 2017-09-09  9:19 Konstantin Khlebnikov
  2017-09-11  9:19 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2017-09-09  9:19 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel

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")
---
 fs/quota/dquot.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 8381db9db6d9..50b0556a124f 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;
 		}
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] quota: add missing lock into __dquot_transfer()
  2017-09-09  9:19 [PATCH] quota: add missing lock into __dquot_transfer() Konstantin Khlebnikov
@ 2017-09-11  9:19 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2017-09-11  9:19 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Jan Kara, linux-kernel

On Sat 09-09-17 12:19:22, Konstantin Khlebnikov wrote:
> 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")

Good catch! Added to my tree. Thanks!

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-11  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-09  9:19 [PATCH] quota: add missing lock into __dquot_transfer() Konstantin Khlebnikov
2017-09-11  9:19 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®