On Tue, Apr 04, 2017 at 04:53:58AM -0700, Matthew Wilcox wrote: > I'd like us to focus on our POSIX compliance here and not return > arbitrary errors. The relevant pages are here: > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html > http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html > http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html > > For close(), we have to map every error to EIO. I don't believe that's true. POSIX explicitly states that implementations may return additional errors, and define additional errors, in addition to the ones that are listeds in the specification. The specification is pretty clear about saying when a particular system call "shall" fail (meaning it must fail if it was so listed), and when it "may" fail. But no where does it say that these are the only situations when a system call is allowed to fail. Which is good, because ext4 and xfs will both return EUCLEAN if the file system is corrupted. (Mainly because it's too painful to define a new errno, EFSCORRUPTED --- not because of trying to get it into Posix, but because it's painful to get new errno's defined in glibc.) POSIX says *nothing* about file systems being corrupted, and if your interpretation were correct, we're already in violation of POSIX.... - Ted