grub-devel
[Top][All Lists]
Advanced

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

Re: gzio/http problem


From: Andrei Borzenkov
Subject: Re: gzio/http problem
Date: Fri, 29 Apr 2016 07:08:56 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

29.04.2016 00:54, Vladimir 'phcoder' Serbinenko пишет:
> HTTP code should never return short reads. The whole subsystem relies on
> never having short reads from any fs or network driver
> 

HTTP code never returns short reads itself. But it sets EOF on socket in
case something bad happens, and in this case we return currently
received data to caller in net core.

      if (!net->eof)
        {
          try++;
          grub_net_poll_cards (GRUB_NET_INTERVAL +
                               (try * GRUB_NET_INTERVAL_ADDITION),
&net->stall);
        }
      else
        return total;

Disallowing short reads means also we should also disallow files with
unknown size. I think that's unrealistic.

> Le ven. 29 avr. 2016 09:30, Stefan Fritsch <address@hidden> a écrit :
> 
>> On Thursday 28 April 2016 21:52:27, Stefan Fritsch wrote:
>>> You are right, I was misreading the second part of the code with
>>> the  direct read. Now I wonder why the patch helped with our
>>> problem. I will do some more debugging.
>>
>> The real problem seems to be that http sometimes (depending on network
>> timing?) returns short reads but gzio does not check how many bytes
>> have actually been read. The looping in my patch for grub_bufio_read()
>> fixed this by never returning a short read.
>>
>> I guess two things should be fixed: gzio should check the return value
>> of grub_file_read(), and (assuming that other code depends on there
>> not being short reads, too) http should be fixed. Or maybe
>> grub_file_read() should get a loop that ensures that there are no
>> short reads?
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]