Remove special cases for ETXTBSY from new fsync'ing logic.

The argument that this is a sufficiently-expected case to be silently
ignored seems pretty thin.  Andres had brought it up back when we were
still considering that most fsync failures should be hard errors, and it
probably would be legit not to fail hard for ETXTBSY --- but the same is
true for EROFS and other cases, which is why we gave up on hard failures.
ETXTBSY is surely not a normal case, so logging the failure seems fine
from here.
This commit is contained in:
Tom Lane 2015-05-29 15:11:36 -04:00
parent 1c8c656b3c
commit 57e1138bcc
2 changed files with 3 additions and 24 deletions

View File

@ -2648,18 +2648,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel)
{
if (errno == EACCES || (isdir && errno == EISDIR))
return;
#ifdef ETXTBSY
if (errno == ETXTBSY)
return;
#endif
ereport(elevel,
(errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", fname)));
return;
}
/*
* We ignore errors from pg_flush_data() because this is only a hint.
*/
(void) pg_flush_data(fd, 0, 0);
(void) CloseTransientFile(fd);
@ -2703,12 +2700,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel)
{
if (errno == EACCES || (isdir && errno == EISDIR))
return;
#ifdef ETXTBSY
if (errno == ETXTBSY)
return;
#endif
ereport(elevel,
(errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", fname)));

View File

@ -619,12 +619,6 @@ pre_sync_fname(const char *fname, bool isdir)
{
if (errno == EACCES || (isdir && errno == EISDIR))
return;
#ifdef ETXTBSY
if (errno == ETXTBSY)
return;
#endif
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, fname, strerror(errno));
return;
@ -684,12 +678,6 @@ fsync_fname_ext(const char *fname, bool isdir)
{
if (errno == EACCES || (isdir && errno == EISDIR))
return;
#ifdef ETXTBSY
if (errno == ETXTBSY)
return;
#endif
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, fname, strerror(errno));
return;