summaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorJeff Liu <jeff.liu@oracle.com>2012-07-18 12:12:41 +0800
committerJan Kara <jack@suse.cz>2012-08-15 00:22:57 +0200
commit6ea2eea1fa930b9308a06f77fce65c38931eeb13 (patch)
tree39ee0487bdcbb9e1c1d9d6c250a4a3f1b36e80dd /fs/quota
parentdc141a402b9dc03a4188cd978a4cf149c397172c (diff)
downloadlinux-6ea2eea1fa930b9308a06f77fce65c38931eeb13.tar.bz2
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>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 36a29b753c79..c495a3055e2a 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -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])