mirror of https://gitee.com/openkylin/linux.git
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:
parent
dc141a402b
commit
6ea2eea1fa
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue