Bug 1464611 - Close file descriptor, flush buffers on grub.cfg and directory before exiting
Close file descriptor, flush buffers on grub.cfg and directory before exiting
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grubby (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Peter Jones
Release Test Team
Depends On:
Blocks: 1466036
  Show dependency treegraph
Reported: 2017-06-23 18:40 EDT by François Cami
Modified: 2018-06-20 22:50 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1466036 (view as bug list)
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description François Cami 2017-06-23 18:40:38 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.

How reproducible:
Nearly always.

Steps to Reproduce:
1. Create a RHEL7 VM called rhel7-vm in KVM, with IP=
2. Run "ssh root@$ grubby --args elevator=deadline --update-kernel DEFAULT && virsh destroy rhel7-vm"
3. Run "virsh start rhel7-vm"

Actual results:
VM is stopped at grub prompt due to a missing grub.cfg configuration file: this is typically repaired by a filesystem journal replay.

Expected results:
VM boots.

Additional info:
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.
Comment 2 François Cami 2017-06-23 18:44:37 EDT
Upstream PR: https://github.com/rhboot/grubby/pull/24

Note You need to log in before you can comment on or make changes to this bug.