Re: [PATCH 1/2] btrfs-progs: avoid duplicate checks on user provided devid

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

 



On Mon, Jun 01, 2015 at 02:25:17PM +0800, Anand Jain wrote:
> kernel is already checking it (rightly), we don't need to check that in the user land.

Sometimes it's useful to duplicate the checks in userspace because we
can fail early and return the error message directly, compared to
messages in syslog or a simple errno.

Have you observed that the userspace checks were problematic?

> @@ -214,33 +213,7 @@ static int cmd_start_replace(int argc, char **argv)
>  	}
>  
>  	if (is_numerical(srcdev)) {
> -		struct btrfs_ioctl_fs_info_args fi_args;
> -		struct btrfs_ioctl_dev_info_args *di_args = NULL;
> -
>  		start_args.start.srcdevid = arg_strtou64(srcdev);
> -
> -		ret = get_fs_info(path, &fi_args, &di_args);

This does additional checks, like checking where it's mounted.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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