Red Hat Bugzilla – Bug 224078
lvm(8) can leave a truncated /etc/lvm/.cache file
Last modified: 2007-11-16 20:14:55 EST
The lvm(8) family of commands can leave a truncated /etc/lvm/.cache file if the
root filesystem becomes full while the file is being written. If the system is
rebooted at that point it will fail to boot because the subsequent vgscan(8)
will croak when it attempts to parse the incomplete cache file.
The problem is that the persistent_filter_dump() function does not check the
return value of any of the writes or fclose(). In fact, simply checking the
return value of the fclose() and not renaming the temporary file if the close
fails should be sufficient. This obviously assumes persistent_filter_dump() has
already been augmented to write to a temporary file and call rename() before
returning (a change that has already been submitted).
*** Bug 224079 has been marked as a duplicate of this bug. ***
fclose() check included in lvm2-2.02.20-1.el4
No fwrite() checks yet.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.