From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Liu Subject: [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on() Date: Sun, 22 Apr 2012 14:16:13 +0800 Message-ID: <4F93A22D.300@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: jack@suse.cz To: "linux-fsdevel@vger.kernel.org" Return-path: Received: from rcsinet15.oracle.com ([148.87.113.117]:26369 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082Ab2DVOSr (ORCPT ); Sun, 22 Apr 2012 10:18:47 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Jan, When executing quotaon(8), all the file systems(ext3/ext4/reiserfs) binded to the VFS quota framework have already ensured that the quota files are resides on the same file system with the specified super block before invoking dquot_quota_on(), looks like we can be safely remove it from there IMHO. Signed-off-by: Jie Liu --- fs/quota/dquot.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 4674197..cb917a2 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2199,13 +2199,10 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id, int error = security_quota_on(path->dentry); if (error) return error; - /* Quota file not on the same filesystem? */ - if (path->dentry->d_sb != sb) - error = -EXDEV; - else - error = vfs_load_quota_inode(path->dentry->d_inode, type, - format_id, DQUOT_USAGE_ENABLED | - DQUOT_LIMITS_ENABLED); + + error = vfs_load_quota_inode(path->dentry->d_inode, type, + format_id, DQUOT_USAGE_ENABLED | + DQUOT_LIMITS_ENABLED); return error; } EXPORT_SYMBOL(dquot_quota_on); -- 1.7.9