Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gzI4t-0003ps-KB for mharc-grub-devel@gnu.org; Thu, 28 Feb 2019 04:34:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzI4s-0003pk-29 for grub-devel@gnu.org; Thu, 28 Feb 2019 04:34:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzI4r-0004C5-2x for grub-devel@gnu.org; Thu, 28 Feb 2019 04:34:05 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:51013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzI4p-00049q-3J for grub-devel@gnu.org; Thu, 28 Feb 2019 04:34:04 -0500 Received: from 139.35.155.90.in-addr.arpa ([90.155.35.139] helo=riva.pelham.vpn.ucam.org) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gzI4c-0005vg-6i for grub-devel@gnu.org; Thu, 28 Feb 2019 09:33:50 +0000 Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org) by riva.pelham.vpn.ucam.org with esmtp (Exim 4.89) (envelope-from ) id 1gzI4b-0003Fh-Bt for grub-devel@gnu.org; Thu, 28 Feb 2019 09:33:49 +0000 Date: Thu, 28 Feb 2019 09:33:49 +0000 From: Colin Watson To: grub-devel@gnu.org Subject: Re: [PATCH] util: Detect more I/O errors Message-ID: <20190228093349.rt6iz2bgrmux2x4h@riva.ucam.org> References: <155065044692.1778.10181739878482866355.reportbug@frontier> <20190227091008.ley2ngnc5lbvr4ox@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190227091008.ley2ngnc5lbvr4ox@riva.ucam.org> User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 91.189.89.112 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 09:34:06 -0000 On Wed, Feb 27, 2019 at 09:10:08AM +0000, Colin Watson wrote: > Many of GRUB's utilities don't check anywhere near all the possible > write errors. For example, if grub-install runs out of space when > copying a file, it won't notice. There were missing checks for the > return values of write, fflush, fsync, and close (or the equivalents on > other OSes), all of which must be checked. > > I tried to be consistent with the existing logging practices of the > various hostdisk implementations, but they weren't entirely consistent > to start with so I used my judgement. The result at least looks > reasonable on GNU/Linux when I provoke a write error: > > Installing for x86_64-efi platform. > grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/debian/grubx64.efi': No space left on device. > > There are more missing checks in other utilities, but this should fix > the most critical ones. > > Fixes Debian bug #922741. Oh, I forgot to include it in the commit message, but this is: Signed-off-by: Colin Watson -- Colin Watson [cjwatson@ubuntu.com]