Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MtQIs-0005lN-Uw for mharc-grub-devel@gnu.org; Thu, 01 Oct 2009 14:22:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtQIr-0005jm-QE for grub-devel@gnu.org; Thu, 01 Oct 2009 14:22:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtQIm-0005dT-Pl for grub-devel@gnu.org; Thu, 01 Oct 2009 14:22:57 -0400 Received: from [199.232.76.173] (port=42649 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtQIm-0005d7-Kk for grub-devel@gnu.org; Thu, 01 Oct 2009 14:22:52 -0400 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:57535) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtQIl-0005x2-M8 for grub-devel@gnu.org; Thu, 01 Oct 2009 14:22:51 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MtQIi-0002LJ-1j for grub-devel@gnu.org; Thu, 01 Oct 2009 18:22:48 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1MtQIh-0003Pn-00; Thu, 01 Oct 2009 19:22:47 +0100 Date: Thu, 1 Oct 2009 19:22:47 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20091001182247.GA13111@riva.ucam.org> References: <20090930225430.GX13423@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090930225430.GX13423@riva.ucam.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Create environment block safely X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2009 18:22:58 -0000 On Wed, Sep 30, 2009 at 11:54:30PM +0100, Colin Watson wrote: > If grub-editenv create is interrupted, it's theoretically possible for > it to create an incomplete block that future grub-editenv calls won't > recognise. It would be better for it to atomically create either a > complete block or nothing. Any objections? > > 2009-09-30 Colin Watson > > * util/grub-editenv.c (create_envblk_file): Write new block with a > .new suffix and then rename it into place, to ensure atomic > creation. I've gone ahead and committed this, since it's straightforward enough. -- Colin Watson [cjwatson@ubuntu.com]