diff options
author | Thomas Munro <tmunro@postgresql.org> | 2019-02-24 23:59:26 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2019-02-24 23:59:26 +1300 |
commit | ad714c6072c9482ffd398716fdc018f25c5c2fb0 (patch) | |
tree | 0df7d1dec576e81c7b00fc5dcba2d6cf52fe7ee4 /src/backend/storage/file/fd.c | |
parent | 64b8c51bccad13462a8876f269c746e24e9068fd (diff) |
Tolerate EINVAL when calling fsync() on a directory.
Previously, we tolerated EBADF as a way for the operating system to
indicate that it doesn't support fsync() on a directory. Tolerate
EINVAL too, for older versions of Linux CIFS.
Bug #15636. Back-patch all the way.
Reported-by: John Klann
Discussion: https://postgr.es/m/15636-d380890dafd78fc6@postgresql.org
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r-- | src/backend/storage/file/fd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 757aa083a0c..6d016a79e93 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3167,7 +3167,7 @@ fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel) * Some OSes don't allow us to fsync directories at all, so we can ignore * those errors. Anything else needs to be logged. */ - if (returncode != 0 && !(isdir && errno == EBADF)) + if (returncode != 0 && !(isdir && (errno == EBADF || errno == EINVAL))) { int save_errno; |