[Bug 37435] Re: [Bug 37435] Re: maintainer of /var/lib/dpkg/alternatives/ doesn't do updates safely
Ian Jackson
iwj at ubuntu.com
Wed May 10 14:09:16 UTC 2006
Stewart Smith writes ("[Bug 37435] Re: maintainer of /var/lib/dpkg/alternatives/ doesn't do updates safely"):
> There is no gaurentee that the data hits disk without an explicit
> fsync (or clean shutdown).
But update-alternatives doesn't care whether the data hits the disk.
It would be just fine if neither the file data nor the rename were
committed. Indeed, this is the desired behaviour because committing
to disk is comparatively slow and installation/upgrade performance is
important.
The bug in the filesystem isn't that it doesn't sync the data. It's
that it writes the metadata without writing the contents, and has no
means for fixing this up after a hard crash. It leaves the disk and
the system in a state where the file contains garbage.
Note that _almost any_ application which updates a file via the UNIX
API _must_ do exactly what update-alternatives does: write out new
data to a new file, and rename it over the old version. Are you
saying that all of those applications are wrong and should always sync
the data before renaming ?
Ian.
--
maintainer of /var/lib/dpkg/alternatives/ doesn't do updates safely
https://launchpad.net/bugs/37435
More information about the kernel-bugs
mailing list