Red Hat Bugzilla – Bug 1464611
Close file descriptor, flush buffers on grub.cfg and directory before exiting
Last modified: 2017-10-10 23:40:32 EDT
Description of problem:
Running grubby even to add kernel parameters to the command-line and then rebooting "hard" (power outage or open file descriptor in /boot) often results in boot issues.
Booting manually, or mounting (and playing the journal) of the /boot filesystem repairs the issue most of the time.
Version-Release number of selected component (if applicable):
though looking at upstream ( https://github.com/rhboot/grubby ) all versions up to and including 34b1436ccbd56eab8024314cab48f2fc880eef08 seem problematic.
Steps to Reproduce:
1. Create a RHEL7 VM called rhel7-vm in KVM, with IP=192.168.122.10
2. Run "ssh root@$192.168.122.10 grubby --args elevator=deadline --update-kernel DEFAULT && virsh destroy rhel7-vm"
3. Run "virsh start rhel7-vm"
VM is stopped at grub prompt due to a missing grub.cfg configuration file: this is typically repaired by a filesystem journal replay.
writeConfig() doesn't close its configuration file before rename() is called, nor when/before the process exits successfully.
fsync() is not called on the configuration file nor on the configuration directory.
Upstream PR: https://github.com/rhboot/grubby/pull/24