Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf16735d

Browse files
committed
Tolerate EINVAL when calling fsync() on a directory.
Previously, we tolerated EBADF as a way for the operating system toindicate that it doesn't support fsync() on a directory. TolerateEINVAL too, for older versions of Linux CIFS.Bug #15636. Back-patch all the way.Reported-by: John KlannDiscussion:https://postgr.es/m/15636-d380890dafd78fc6@postgresql.org
1 parent483520e commitf16735d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,7 @@ fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel)
33793379
* Some OSes don't allow us to fsync directories at all, so we can ignore
33803380
* those errors. Anything else needs to be logged.
33813381
*/
3382-
if (returncode!=0&& !(isdir&&errno==EBADF))
3382+
if (returncode!=0&& !(isdir&&(errno==EBADF||errno==EINVAL)))
33833383
{
33843384
intsave_errno;
33853385

‎src/common/file_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ fsync_fname(const char *fname, bool isdir, const char *progname)
299299
* Some OSes don't allow us to fsync directories at all, so we can ignore
300300
* those errors. Anything else needs to be reported.
301301
*/
302-
if (returncode!=0&& !(isdir&&errno==EBADF))
302+
if (returncode!=0&& !(isdir&&(errno==EBADF||errno==EINVAL)))
303303
{
304304
fprintf(stderr,_("%s: could not fsync file \"%s\": %s\n"),
305305
progname,fname,strerror(errno));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp