Skip to content

Commit

Permalink
quota: Move down dqptr_sem read after initializing default warn[] typ…
Browse files Browse the repository at this point in the history
…e 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>
  • Loading branch information
Jeff Liu authored and Jan Kara committed Aug 14, 2012
1 parent dc141a4 commit 6ea2eea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 6ea2eea

Please sign in to comment.