From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Liu Subject: [PATCH] quota: Move down dqptr_sem read after initializing default warn[] type at __dquot_alloc_space(). Date: Wed, 18 Jul 2012 12:12:41 +0800 Message-ID: <500637B9.7050808@oracle.com> Reply-To: jeff.liu@oracle.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jan Kara To: "linux-fsdevel@vger.kernel.org" Return-path: Received: from rcsinet15.oracle.com ([148.87.113.117]:17424 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726Ab2GREN1 (ORCPT ); Wed, 18 Jul 2012 00:13:27 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, sb->s_dqout->dqptr_sem is used to serialize ops using quota_info for pointers from inode to dquots. But for __dquot_alloc_space(), it could be safely moved down after the default warn[] array got initialized IMHO. Thanks, -Jeff Signed-off-by: Jie Liu --- fs/quota/dquot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 10cbe84..510ae87 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1571,10 +1571,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]) -- 1.7.4.1