Re: [PATCH 2/2] btrfs-progs: device delete to accept devid

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

 



Hi Anand
On 2015-08-14 12:36, Anand Jain wrote:
> This patch introduces new option <devid> for the command
> 
[...]

> +
> +		if (is_numerical(argv[i])) {
> +			argv3.devid = arg_strtou64(argv[i]);
> +			its_num = true;
> +		} else if (is_block_device(argv[i])) {


please be aware that is_block_device(), returns 
- 1 if the file is a block device, 
- < 0 in case of an error (eg: file not found)
- 0 otherwise

so I suggest to change the check in

 +		} else if (is_block_device(argv[i]) == 1) {

[...]


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5
--
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