Re: [PATCH 3/3] btrfs-progs: fi usage: cleanup unneccessary permission error check

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

 




On 2017年11月30日 15:53, Misono, Tomohiro wrote:
> Since BTRFS_IOC_FS_INFO does not require root privilege, there is no
> need to check EPERM error.
> 
> Signed-off-by: Tomohiro Misono <misono.tomohiro@xxxxxxxxxxxxxx>

Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>

Thanks,
Qu
> ---
>  cmds-fi-usage.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
> index 7bbc9896..b0721560 100644
> --- a/cmds-fi-usage.c
> +++ b/cmds-fi-usage.c
> @@ -522,8 +522,6 @@ static int load_device_info(int fd, struct device_info **device_info_ptr,
>  
>  	ret = ioctl(fd, BTRFS_IOC_FS_INFO, &fi_args);
>  	if (ret < 0) {
> -		if (errno == EPERM)
> -			return -errno;
>  		error("cannot get filesystem info: %s",
>  				strerror(errno));
>  		return 1;
> @@ -597,11 +595,6 @@ int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo,
>  	}
>  
>  	ret = load_device_info(fd, devinfo, devcount);
> -	if (ret == -EPERM) {
> -		warning(
> -		"cannot get filesystem info from ioctl(FS_INFO), run as root");
> -		ret = 0;
> -	}
>  
>  	return ret;
>  }
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux