Re: [PATCH 05/10] Add a new clustered disk

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

 



NeilBrown wrote:
> On Fri, 24 Apr 2015 15:30:36 +0800 gqjiang@xxxxxxxx wrote:
>
>   
>> From: Guoqing Jiang <gqjiang@xxxxxxxx>
>>
>> A clustered disk is added by the traditional --add sequence.
>> However, other nodes need to acknowledge that they can "see"
>> the device. This is done by --cluster-confirm:
>>
>> --cluster-confirm Y:/dev/whatever (if disk is found)
>> or
>> --cluster-confirm Y:missing (if disk is not found)
>>
>> The node initiating the --add, has the disk state tagged with
>> MD_DISK_CLUSTER_ADD and the one confirming tag the disk with
>> MD_DISK_CANDIDATE.
>>     
>
> You haven't explained 'Y' here.  It looks like it means 'Yes', but it doesn't.
>
>
>   
Right, actually 'Y' stands for the slot, will modify it.
>> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
>> Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx>
>>
>>     
[snip]
>>  
>> +int parse_cluster_confirm_arg(char *input, char **devname, int *slot)
>> +{
>> +	char *dev;
>> +	*slot = strtoul(input, &dev, 10);
>> +	if (dev[0] == ':')
>> +		*devname = dev+1;
>> +	else
>> +		return -1;
>> +	return 0;
>> +}
>>     
>
> The logic here hurts my brain :-(
>
>  *slot = strtoul(input, &dev, 10);
>  if (dev == input || dev[0] != ':')
>      return -1;
>  *devname = dev+1;
>  return 0;
>
>   
Thanks for above, :)

Regards,
Guoqing
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux