Skip to content

Commit 6ea2eea

Browse files
pibrochjankara
authored andcommitted
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>
1 parent dc141a4 commit 6ea2eea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/quota/dquot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,10 +1589,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
15891589
goto out;
15901590
}
15911591

1592-
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
15931592
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
15941593
warn[cnt].w_type = QUOTA_NL_NOWARN;
15951594

1595+
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
15961596
spin_lock(&dq_data_lock);
15971597
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
15981598
if (!dquots[cnt])

0 commit comments

Comments
 (0)