revert prior patch to fsync directories until portability problems exposed by build farm can be sorted out
This commit is contained in:
parent
36e1ed02bf
commit
1f2aeca060
@ -11,7 +11,7 @@
|
|||||||
* as a service.
|
* as a service.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.23.2.1 2010/02/14 17:50:47 stark Exp $
|
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.23.2.2 2010/02/16 00:01:35 stark Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -50,7 +50,6 @@ copydir(char *fromdir, char *todir, bool recurse)
|
|||||||
{
|
{
|
||||||
DIR *xldir;
|
DIR *xldir;
|
||||||
struct dirent *xlde;
|
struct dirent *xlde;
|
||||||
int dirfd;
|
|
||||||
char fromfile[MAXPGPATH];
|
char fromfile[MAXPGPATH];
|
||||||
char tofile[MAXPGPATH];
|
char tofile[MAXPGPATH];
|
||||||
|
|
||||||
@ -92,26 +91,6 @@ copydir(char *fromdir, char *todir, bool recurse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FreeDir(xldir);
|
FreeDir(xldir);
|
||||||
|
|
||||||
/*
|
|
||||||
* fsync the directory to make sure not just the data but also the
|
|
||||||
* new directory file entries have reached the disk. While needed
|
|
||||||
* by most filesystems, the window got bigger with newer ones like
|
|
||||||
* ext4.
|
|
||||||
*/
|
|
||||||
dirfd = BasicOpenFile(todir,
|
|
||||||
O_RDONLY | PG_BINARY,
|
|
||||||
S_IRUSR | S_IWUSR);
|
|
||||||
if(dirfd == -1)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode_for_file_access(),
|
|
||||||
errmsg("could not open directory for fsync \"%s\": %m", todir)));
|
|
||||||
|
|
||||||
if(pg_fsync(dirfd) == -1)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode_for_file_access(),
|
|
||||||
errmsg("could not fsync directory \"%s\": %m", todir)));
|
|
||||||
close(dirfd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user