[pnfs] [PATCH 07/10] pnfs: Move getdeviceinfo to draft-19 on client

Dean Hildebrand seattleplus at gmail.com
Mon Feb 11 17:32:16 EST 2008



Benny Halevy wrote:
> On Feb. 10, 2008, 11:28 +0200, Benny Halevy <bhalevy at panasas.com> wrote:
>   
>> On Feb. 09, 2008, 10:26 +0200, Marc Eshel <eshel at almaden.ibm.com> wrote:
>>     
>>> From: Dean Hildebrand <dhildeb at us.ibm.com>
>>> +	/* Always 1 bitmap */
>>>       
>> Hmm, I believe it's legal to get a zero length bitmap on the result.
>>
>>     
>>> +	READ_BUF(8);
>>> +	READ32(tlen);
>>> +	READ32(res->dev_notify_types);
>>>       
>> 	if (tlen)
>> 		READ32(res->dev_notify_types);
>> 	else
>> 		res->dev_notify_types = 0;
>>     
>
> Actually, READ_BUF(8) is wrong in the tlen == 0 case, so that should be:
>
> +	/* At most one bitmap word */
> +	READ_BUF(4);
> +	READ32(tlen);
> +	if (tlen) {
> +		READ_BUF(4);
> +		READ32(res->dev_notify_types);
> +	} else
> +		res->dev_notify_types = 0;
>
>   
Yes, good catch.  I didn't realize it could be zero.....
Dean


More information about the pNFS mailing list