Re: [RFC][PATCH 18/27] sys_faccessat(): collapse if()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 07, 2006 at 05:10:29PM -0700, Dave Hansen wrote:
> 
> This patch should make no functional changes.

wrong order, but IMHO this one should do the
goto out_path_release change of the previous
one

best,
Herbert

> Signed-off-by: Dave Hansen <haveblue@xxxxxxxxxx>
> ---
> 
>  lxc-dave/fs/open.c |   18 ++++++++++--------
>  1 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff -puN fs/open.c~elevate-writers-opens-part2-sys_faccessat fs/open.c
> --- lxc/fs/open.c~elevate-writers-opens-part2-sys_faccessat	2006-06-07 16:53:23.000000000 -0700
> +++ lxc-dave/fs/open.c	2006-06-07 16:53:23.000000000 -0700
> @@ -537,15 +537,17 @@ asmlinkage long sys_faccessat(int dfd, c
>  		current->cap_effective = current->cap_permitted;
>  
>  	res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
> -	if (!res) {
> -		res = vfs_permission(&nd, mode);
> -		/* SuS v2 requires we report a read only fs too */
> -		if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
> -		   && !special_file(nd.dentry->d_inode->i_mode))
> -			res = -EROFS;
> -		path_release(&nd);
> -	}
> +	if (res)
> +		goto out;
>  
> +	res = vfs_permission(&nd, mode);
> +	/* SuS v2 requires we report a read only fs too */
> +	if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
> +	   && !special_file(nd.dentry->d_inode->i_mode))
> +		res = -EROFS;
> +	path_release(&nd);
> +
> +out:
>  	current->fsuid = old_fsuid;
>  	current->fsgid = old_fsgid;
>  	current->cap_effective = old_cap;
> _
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux