tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Removing softdep


time of the crash. Many good safety conscious applications already do that without avoiding the basic benefits of the buffer cache by writing new data to temporary files and then doing and fsync() before closing and finally renaming them into place. It's the unix way. :-)

If I catch your point correctly, your old data won't be corrupted in case of a crash (admitting that it doesn't happen in the middle of the rename ()), but you risk losing those which were written to the /tmp file.

That's going to be terribly slow on any mechanical rotating storage device without a write-back cache somewhere below in the hardware layer, and just as unreliable with a write-back cache if you can't guarantee it will get safely flushed before the hardware is reset somehow.

I think there is no correct solution, just best compromises. If an unexpected power loss happens in the middle of a write, data will be lost, point. I heard some disks had a kind of big capacitor stocking energy and could at least write part, if not all, of their internal cache using that spared energy and the rotating inertia of the disk. Realty or fantasy? I can't tell, but, anyhow, that escapes totally the OS power (unless we can disable the internal cache by a suitable order).


Home | Main Index | Thread Index | Old Index