From: Jeff Mahoney Date: Wed, 27 Feb 2013 19:43:09 +0000 (-0500) Subject: quota: add missing use of dq_data_lock in __dquot_initialize X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68ac8bfb6aa4ce1a146b5a291f03fc2dd6d17cf2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git quota: add missing use of dq_data_lock in __dquot_initialize The bulk of __dquot_initialize runs under the dqptr_sem which protects the inode->i_dquot pointers. It doesn't protect the dereferenced contents, though. Those are protected by the dq_data_lock, which is missing around the dquot_resv_space call. Signed-off-by: Jeff Mahoney Signed-off-by: Jan Kara --- diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 05ae3c97f7a5..3e64169ef527 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1439,8 +1439,11 @@ static void __dquot_initialize(struct inode *inode, int type) * did a write before quota was turned on */ rsv = inode_get_rsv_space(inode); - if (unlikely(rsv)) + if (unlikely(rsv)) { + spin_lock(&dq_data_lock); dquot_resv_space(inode->i_dquot[cnt], rsv); + spin_unlock(&dq_data_lock); + } } } out_err: