From f16735d80d2fbe1c86f4ac044ee66fe2073b8877 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sun, 24 Feb 2019 23:48:52 +1300 Subject: 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 --- src/backend/storage/file/fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/storage/file/fd.c') diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index d46639d2ede..1ba0ddac107 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3379,7 +3379,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; -- cgit v1.2.3