Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS
Date
Msg-id 1325537384-sup-6201@alvh.no-ip.org
Whole thread Raw
In response to Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS
Next
From: Tom Lane
Date:
Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS