From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>,
Josef Bacik <jbacik@fb.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH 1/3] push/pop errno in initrd read file path
Date: Sat, 12 Mar 2016 10:01:22 +0300 [thread overview]
Message-ID: <56E3BEC2.3040200@gmail.com> (raw)
In-Reply-To: <CAEaD8JP0Xmpc4Aj_fk4_+DW45ov2Vj6g5KQaoe+QHbNffTMatw@mail.gmail.com>
12.03.2016 01:00, Vladimir 'phcoder' Serbinenko пишет:
> On Friday, March 11, 2016, Josef Bacik <jbacik@fb.com> wrote:
>
>> On 03/11/2016 02:34 PM, Vladimir 'phcoder' Serbinenko wrote:
>>
>>>
>>>
>>> Le ven. 11 mars 2016 19:13, Josef Bacik <jbacik@fb.com
>>> <mailto:jbacik@fb.com>> a écrit :
>>>
>>> On 03/11/2016 12:23 PM, Vladimir 'phcoder' Serbinenko wrote:
>>> >
>>> >
>>> > On Friday, March 11, 2016, Josef Bacik <jbacik@fb.com
>>> <mailto:jbacik@fb.com>
>>> > <mailto:jbacik@fb.com <mailto:jbacik@fb.com>>> wrote:
>>> >
>>> > If you try to load an initrd from http and it errors out we
>>> will
>>> > free the initrd
>>> > context but continue on because net_tcp_socket_close() will
>>> reset
>>> > the grub_errno
>>> > as will grub_initrd_close(). So we'll lose the errno and
>>> return
>>> > GRUB_ERR_NONE
>>> > instead of the original error. Add push/pulls to the
>>> appropriate
>>> > places so we
>>> > don't lose our errno. Thanks,
>>> >
>>> > Close functions shouldn't do this. Can you fix them instead? Also
>>> please
>>> > add [2.02] to the subjectwhen appropriate, like in this case.
>>> >
>>>
>>> So do we not want close functions to do grub_error() at all? Seems
>>> like
>>> there may be some cases where we want to know there was an error
>>> closing
>>> a tcp socket or the initrd? Maybe not, just want to make sure before
>>> I
>>> go make these two functions void.
>>>
>>> How can a failure occur in close routines? What can we do with the
>>> failure anyway?
>>>
It is not about problems in close routines themselves, but we call them
to cleanup and lose errors that caused us to clean up.
>>
>> So sending the FIN packet for the tcp close was failing for example. I
>> don't think we can do anything really, I just don't like doing a patch 4
>> times, so I want to make sure turning these close functions into void's is
>> ok. Thanks,
>>
>> I prefer void close functions. Give it another day and if nobody objects
> by then, then it's fine for everyone.
>
May be I miss something obvious here - which close functions do you
mean? grub_net_tcp_close() is void already, like is grub_initrd_close.
So what exactly do you suggest to change?
The problem is that we lose error indication from upper level protocols
or preceding code every time we close file or socket due to previous error.
next prev parent reply other threads:[~2016-03-12 7:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 16:28 [PATCH 1/3] push/pop errno in initrd read file path Josef Bacik
2016-03-11 16:28 ` [PATCH 2/3] tcp: add a dprintf for opening tcp connections Josef Bacik
2016-03-11 16:28 ` [PATCH 3/3] pxenet: process transmit interrupts when out of resources Josef Bacik
2016-03-12 6:20 ` Andrei Borzenkov
2016-03-11 17:23 ` [PATCH 1/3] push/pop errno in initrd read file path Vladimir 'phcoder' Serbinenko
2016-03-11 18:13 ` Josef Bacik
2016-03-11 19:34 ` Vladimir 'phcoder' Serbinenko
2016-03-11 20:34 ` Josef Bacik
2016-03-11 22:00 ` Vladimir 'phcoder' Serbinenko
2016-03-12 7:01 ` Andrei Borzenkov [this message]
2016-03-15 17:26 ` Vladimir 'phcoder' Serbinenko
2016-11-10 12:49 ` Daniel Kiper
2016-11-18 14:51 ` Josef Bacik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E3BEC2.3040200@gmail.com \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).