Comment 29 for bug 439784

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block

On Tue, Oct 13, 2009 at 05:29:10PM -0000, Jordan wrote:
> I have not confirmed this yet by looking at any code, but the reason
> that grubenv is ending up zero bytes is likely that some code is writing
> to grubenv ( from linux, not grub itself ) by doing something like:
> write file "grubenv.tmp"; unlink file "grubenv"; rename "grubenv.tmp" ,
> "grubenv". The reason this is likely being done is that
> /boot/grub/grubenv is read only. The problem is that unless in
> data=ordered mode ext* ( this affects ext3 also now that ordered mode is
> not default ) will sometimes write metadata before data. The work around
> to prevent zero byte files was to implicitly fsync when renaming over an
> existing file; because the code is unlinking grubenv first this implicit
> fsync is not triggered.

grub-editenv already does an *explicit* fsync, so I don't think this can
be it.

In any case, this bug will be fixed properly in my next upload, as per
Felix's suggestion. It's just waiting for me to have a chance to reboot
and test it.