[email protected] (HE12025-12-30): > "No space left on device" is handled by the fs code, when it decides > where to put a block. No need to actually write the block to disk. > Possibly some fs's permanent data are updated and thus scheduled > for write -- again a job for the buffer cache, which has to honour > itself ordering constraints (what to write first, etc.)
You are thinking about it too shallowly. “No space left on device” is not just a matter of how much free space there is, it depends highly on the specifics of the filesystem, and possibly on fine details about the created file. Therefore, the metadata of the filessytem must be updated for the first file before deciding if the second file can be written. And then, the metadata is updated again for the second file, on top of the changes for the first file. That makes it impossible to just discard the changes done in the cache before they are written to the device. What could happen is that the metadata changes are written but the data blocks are marked not dirty before being written. Regards, -- Nicolas George

