1 Jul 2005 03:09
Re: XFS corruption during power-blackout
Stewart Smith <stewart <at> flamingspork.com>
2005-07-01 01:09:01 GMT
2005-07-01 01:09:01 GMT
On Thu, 2005-06-30 at 11:46 -0700, Chris Wedgwood wrote: > Yes, but POSIX is broken in places. The linux implmentation (now and > for sometime but not always) won't return until all dirty data is > flushed. POSIX, in regard to fsync() provides "flexibility for the implementation" - maybe your environment is special and you don't buffer anything, so fsync() is null. Or perhaps you cannot control some of the disk caches, so fsync() is null. In newer systems, you can check for the flag POSIX_SYNCHRONIZED_IO (or similar) that, if set, gaurentees that fsync() is synchronously flushing buffers to disk. However, this only came into the spec in 99 or 2000 i think, so there are still a lot of systems in which you have to know the behaviour. > > and some 'sync' programs do multiple sync()s. > > Such programs are arguably broken (grub maybe?). If one doesn't work, > then why should doing it <n>-times? It's a legacy from the days when it was an async operation. The idea went: that the time it took to type sync and press enter three times (note, no using up-arrow, enter - typing) would be long enough for the buffers that started to get flushed on the first sync to have hit disk. > > And it's also filesystem-type-dependent. > > If a filesystem doesn't flush reliably with sync, I would call that a > bug.(Continue reading)
RSS Feed