From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aedYI-0006hq-JI for mharc-grub-devel@gnu.org; Sat, 12 Mar 2016 02:01:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aedYH-0006hg-1b for grub-devel@gnu.org; Sat, 12 Mar 2016 02:01:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aedYD-0002Py-Ri for grub-devel@gnu.org; Sat, 12 Mar 2016 02:01:28 -0500 Received: from mail-lb0-x241.google.com ([2a00:1450:4010:c04::241]:34893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aedYD-0002Ph-Jm for grub-devel@gnu.org; Sat, 12 Mar 2016 02:01:25 -0500 Received: by mail-lb0-x241.google.com with SMTP id wn5so653736lbb.2 for ; Fri, 11 Mar 2016 23:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=x/iDQgN8GNxJ+CTq4elcan6uzgdhN23gnnsEcZGPxC8=; b=OIO3DIubfM41HmwTx9goQcnfKUeSWOHKdDnd8JhE7vNANH4dRUCzmATj5jstksKlAv H5k5lBWDXZVX3OIBvuYMvqsXOmwhECa007M6F8GTOh0SYzchFYyYyedxJKHWyzyIDVfG h9De1S6TWXTT41Y5VTBv29FjP4M4ONCflPwtfXWSnQidBf89OZ9CJZneHpsiFwnn9Pxl QLcyU28mEF0FUKSknVZWG8pahl0xmSyKXX7/dYGnbL3sYQ3BFqQJaSI6RRDOzrWLCxAO kOLabS4qZZWQLtlFXy4QFhpPfNYSYkdKOhUzysjRbIZzQRBhXfbmr5eZL4/qDcmdmexW DDow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=x/iDQgN8GNxJ+CTq4elcan6uzgdhN23gnnsEcZGPxC8=; b=k1nlJoUDlReD53kQWcwh9rCA4vj6EWffS3NhcijZso/EMBAnWHne73l9X2MimBkqSo 4/Jh9J3EDCElqm94aLWuUcEWz3XjK75DRlWMX+Mx2bTz/XB4Oh65kQrq8Q3kWqB1CW/a ohXxIKQOWC0gv9SVkJVHzmVqIR0E2o5ebp3nV0MgAwFM+RU2L/CFc2WLBhfjVoJqJuQt SoPg+ksv3N0HZzVfNzFJGPv+rUe6SpCFVx7YzaMiGjDBzDdEF410xtW1SdVgkg7UfVSj n+E/2NOVQuTnEScgkd9aTfIiDRdK91kUY8BFWtSLteTbQb8MF6eeJE06sDPRQH2QtFek r3lw== X-Gm-Message-State: AD7BkJIUZP+kjxVJSEr+fVHUoHsIgBFq9swnpBK7LlMqYxykPpCje+kO1GNggJg/O0l/fA== X-Received: by 10.25.154.65 with SMTP id c62mr4833425lfe.54.1457766084712; Fri, 11 Mar 2016 23:01:24 -0800 (PST) Received: from [192.168.1.42] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id n185sm1870327lfd.11.2016.03.11.23.01.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Mar 2016 23:01:23 -0800 (PST) Subject: Re: [PATCH 1/3] push/pop errno in initrd read file path To: The development of GNU GRUB , Josef Bacik References: <1457713715-31708-1-git-send-email-jbacik@fb.com> <56E30AD0.80702@fb.com> <56E32BEB.5050002@fb.com> From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <56E3BEC2.3040200@gmail.com> Date: Sat, 12 Mar 2016 10:01:22 +0300 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 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::241 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: Sat, 12 Mar 2016 07:01:30 -0000 12.03.2016 01:00, Vladimir 'phcoder' Serbinenko пишет: > On Friday, March 11, 2016, Josef Bacik wrote: > >> On 03/11/2016 02:34 PM, Vladimir 'phcoder' Serbinenko wrote: >> >>> >>> >>> Le ven. 11 mars 2016 19:13, Josef Bacik >> > a écrit : >>> >>> 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 >>> 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.