Apparently SMB/CIFS on Linux/macOS returns somewhat random errnos when trying to sync a windows share which does not support calling fsync for a directory.