From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aeTm8-0007jb-Os for mharc-grub-devel@gnu.org; Fri, 11 Mar 2016 15:35:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeTm5-0007hg-S9 for grub-devel@gnu.org; Fri, 11 Mar 2016 15:35:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeTm2-0007bC-Mc for grub-devel@gnu.org; Fri, 11 Mar 2016 15:35:05 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:62003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeTm2-0007aZ-Gs for grub-devel@gnu.org; Fri, 11 Mar 2016 15:35:02 -0500 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.15.0.59/8.15.0.59) with SMTP id u2BKR1As001195; Fri, 11 Mar 2016 12:35:00 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=UiSOq1BjdUWa+NgtBU3N3nQpSno+SGoWBKZDL0cRbiE=; b=L1NrC/5Fn3dBsdC/uOLvqx6o3jiFl7iOwgoTm05fmasQII8Pc48H9Xre4AX9jVVf+saO i4Al0DRpZYtJeb7TI3orJbKU8iL7icjOHm0IsAhOEvwHpflnIRfRAnlbtdWWuPtZTPPP brzTknp8UI+r/q3bmIXphSBJXQveh0IwL4g= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 21kub130xn-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 11 Mar 2016 12:35:00 -0800 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 11 Mar 2016 12:34:55 -0800 Subject: Re: [PATCH 1/3] push/pop errno in initrd read file path To: "Vladimir 'phcoder' Serbinenko" , The development of GRUB 2 References: <1457713715-31708-1-git-send-email-jbacik@fb.com> <56E30AD0.80702@fb.com> From: Josef Bacik Message-ID: <56E32BEB.5050002@fb.com> Date: Fri, 11 Mar 2016 15:34:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-11_10:, , signatures=0 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by m0001303.ppops.net id u2BKR1As001195 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 67.231.153.30 Cc: kernel-team@fb.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2016 20:35:06 -0000 On 03/11/2016 02:34 PM, Vladimir 'phcoder' Serbinenko wrote: > > > Le ven. 11 mars 2016 19:13, Josef Bacik > a =C3=A9crit : > > On 03/11/2016 12:23 PM, Vladimir 'phcoder' Serbinenko wrote: > > > > > > On Friday, March 11, 2016, Josef Bacik > > >> 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 re= turn > > GRUB_ERR_NONE > > instead of the original error. Add push/pulls to the approp= riate > > places so we > > don't lose our errno. Thanks, > > > > Close functions shouldn't do this. Can you fix them instead? Als= o > 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 cl= osing > a tcp socket or the initrd? Maybe not, just want to make sure befo= re I > go make these two functions void. > > How can a failure occur in close routines? What can we do with the > failure anyway? So sending the FIN packet for the tcp close was failing for example. I=20 don't think we can do anything really, I just don't like doing a patch 4=20 times, so I want to make sure turning these close functions into void's=20 is ok. Thanks, Josef