All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on()
@ 2012-04-22  6:16 Jeff Liu
  2012-04-23  7:44 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Liu @ 2012-04-22  6:16 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: jack

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 <jeff.liu@oracle.com>

---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on()
  2012-04-23  7:44 ` Jan Kara
@ 2012-04-23  0:02   ` Jeff Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Liu @ 2012-04-23  0:02 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel

Hi Jan,

On 04/23/2012 03:44 PM, Jan Kara wrote:

>   Hi,
> 
> On Sun 22-04-12 14:16:13, Jeff Liu wrote:
>> 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.
>   Not really, ext2 doesn't perform the check. Also ext3 or reiserfs when
> not using journalled quota don't do the check. So the test has to stay
> there. Is there any special reason why you would like to have it removed?

No special reason, I just found that this check has been done at the beginning
of ext3/ext4/reiserfs->(ext3/ext4/reiserfs)_quota_on() for journalled quota, but not
realized that ext2 quota works without journall. :(
Sorry for the noise!

Thanks,
-Jeff

> 
> 								Honza
> 
>> ---
>>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on()
  2012-04-22  6:16 [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on() Jeff Liu
@ 2012-04-23  7:44 ` Jan Kara
  2012-04-23  0:02   ` Jeff Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2012-04-23  7:44 UTC (permalink / raw)
  To: Jeff Liu; +Cc: linux-fsdevel, jack

  Hi,

On Sun 22-04-12 14:16:13, Jeff Liu wrote:
> 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.
  Not really, ext2 doesn't perform the check. Also ext3 or reiserfs when
not using journalled quota don't do the check. So the test has to stay
there. Is there any special reason why you would like to have it removed?

								Honza

> ---
>  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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-23  8:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-22  6:16 [PATCH]: Remove redundant underlying file system checking that the quota files resides from dquot_quota_on() Jeff Liu
2012-04-23  7:44 ` Jan Kara
2012-04-23  0:02   ` Jeff Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.