Excerpts from Tom Lane's message of lun ene 02 17:28:33 -0300 2012:
> Anyway the immediate question is which errnos are reasonable for copydir
> to ignore. Just looking at the standard's description of fsync's error
> conditions:
>=20
> The fsync() function shall fail if:
> [EBADF]
> The fildes argument is not a valid descriptor.
> [EINTR]
> The fsync() function was interrupted by a signal.
> [EINVAL]
> The fildes argument does not refer to a file on which this operation =
is possible.
> [EIO]
> An I/O error occurred while reading from or writing to the file syste=
m.
>=20
> it seems like EINVAL is a considerably more reasonable thing to return
> than EBADF, if the filesystem is trying to tell you that it won't fsync
> a directory. So I'm a bit surprised this question hasn't come up for
> other filesystems.
Probably because other filesystems do allow you to fsync directories.
In fact for some cases they _require_ it ... remember the fiasco when
MTA writers were told that they needed to fsync their queue dirs in
order for all queued email to persist?
--=20
=C3=81lvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support