On 2/10/24 10:03 am, Left Right wrote:
Consider also an interesting consequence of SCSI not being able to have infinite words: this means, besides other things that fsync() is nonsense! :) If you aren't familiar with the concept: UNIX filesystem API suggests that it's possible to destage arbitrary large file (or a chunk of file) to disk. But SCSI is built of finite "words" and to describe an arbitrary large file you'd need to list all the blocks that constitute the file!
I don't follow. What fsync() does is ensure that any data buffered in the kernel relating to the file is sent to the storage device. It can send as many blocks of data over SCSI as required to achieve this. There's no requirement for it to be atomic at the level of the interface between the kernel and the hardware. Some devices do their own buffering in ways that are invisible to the software, so fsync() can't guarantee that the data is actually written to the storage medium. But that's a problem stemming from the design of the hardware, not the design of the protocol for communicating with the hardware. > the only way to implement fsync() in compliance with the > standard is to sync _everything_ Again I'm not sure what you mean here. It may be difficult for the kernel to track down exactly what data is relevant to a particular file, and so the kernel programmers take the easy way out and just implement fsync() as sync(). But again that has nothing to do with the protocol. -- Greg -- https://mail.python.org/mailman/listinfo/python-list