[Sheepdog] [PATCH v2 5/5] sheep: use SD_STATUS_HALT to stop serving IO

Liu Yuan namei.unix at gmail.com
Mon Oct 17 08:07:41 CEST 2011


On 10/17/2011 01:44 PM, MORITA Kazutaka wrote:

>> +
>>  static int cluster_format(int argc, char **argv)
>>  {
>>  	int fd, ret;
>> @@ -36,6 +43,8 @@ static int cluster_format(int argc, char **argv)
>>  
>>  	hdr.opcode = SD_OP_MAKE_FS;
>>  	hdr.copies = cluster_cmd_data.copies;
>> +	if (cluster_cmd_data.nohalt)
>> +		set_nohalt(&hdr.copies);
> 
> I think we should use hdr.flags to set the nohalt option.


Okay.

>>  
>> +int sys_nohalt()
>> +{
>> +	return sys->nr_sobjs & (1 << 31);
> 
> sys->nr_sobjs is used everywhere in the main thread, so I think this
> doesn't work at all.
> 
> For example:
> 
>   $ sheep /store/0
>   $ collie cluster format -H
>   $ qemu-img create sheepdog:test 4G
>   Formatting 'sheepdog:test', fmt=raw size=4294967296 
>   qemu-img: Failed to write the requested VDI, test
>   qemu-img: sheepdog:test: error while creating raw: Input/output error
> 
> We should declare another field in struct cluster info for the nohalt
> option?


Hmm, I just need one bit for indication. So one more filed is kind of
wasteful. I am considering to change sys->status into bit operation,
each bit stand for one status or other flag like nohalt. How do you
think of it?

Thanks,
Yuan



More information about the sheepdog mailing list