quota: Move down dqptr_sem read after initializing default warn[] type at __dquot_alloc_space().

sb->s_dqopt->dqptr_sem is used to serialize ops using pointers from inode to
dquots.  But for __dquot_alloc_space(), it could be safely moved down after the
default warn[] array got initialized.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Jeff Liu 2012-07-18 12:12:41 +08:00 committed by Jan Kara
parent dc141a402b
commit 6ea2eea1fa
1 changed files with 1 additions and 1 deletions

View File

@ -1589,10 +1589,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
goto out;
}
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
warn[cnt].w_type = QUOTA_NL_NOWARN;
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
spin_lock(&dq_data_lock);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
if (!dquots[cnt])