[sheepdog] [PATCH] dog/vdi: fix panic if number of nodes less than number of copies

Saeki Masaki saeki.masaki at po.ntts.co.jp
Tue Mar 3 02:41:10 CET 2015


On 2015/03/02 22:00, Hitoshi Mitake wrote:
> At Mon,  2 Mar 2015 20:06:29 +0800,
> Ruoyu wrote:
>>
>> Signed-off-by: Ruoyu <liangry at ucweb.com>
>> ---
>>   dog/vdi.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>
> Applied, thanks.
>
> Saeki-san, I think the latest problem you reported would be solved by
> this patch. Could you check the issue?
>
> https://bugs.launchpad.net/sheepdog-project/+bug/1427079

Thank you, Ruoyu.

I tried the same procedure posted in launchpad, and no longer occur error.
and advice message is also easy to understand. It's very good.

I've changed launchpad status to "fix commited"

Regards,
Saeki.


>
> Thanks,
> Hitoshi
>
>>
>> diff --git a/dog/vdi.c b/dog/vdi.c
>> index 6be3304..3a69505 100644
>> --- a/dog/vdi.c
>> +++ b/dog/vdi.c
>> @@ -1137,6 +1137,13 @@ static void print_expected_location(uint64_t oid, int copies)
>>   {
>>   	const struct sd_vnode *vnodes[SD_MAX_COPIES];
>>
>> +	if (sd_nodes_nr < copies) {
>> +		printf("\nBecause number of nodes (%d) is less than "
>> +			"number of copies (%d), the object should be located "
>> +			"at every nodes.\n", sd_nodes_nr, copies);
>> +		return;
>> +	}
>> +
>>   	printf("\nAccording to sheepdog algorithm, "
>>   		   "the object should be located at:\n");
>>   	oid_to_vnodes(oid, &sd_vroot, copies, vnodes);
>> --
>> 1.8.3.2
>>
>>
>> --
>> sheepdog mailing list
>> sheepdog at lists.wpkg.org
>> https://lists.wpkg.org/mailman/listinfo/sheepdog
>






More information about the sheepdog mailing list