1. Some code opens a file, writes some stuff to it, closes, and then fsyncs it, and if that fails and and it ever retries it'll redo all of those steps again. We know that some kernels might have thrown away the data, but we don't care about the copy in the kernel's cache because we'll write it out again next time around.
Can we trust the kernel to be reporting the EIO or ENOSPC only from writeback buffers for the actual file we're fsync()ing though? Not from buffers it flushed while performing our fsync() request, failed to flush, and complained about?