deploy: Drop fsync of modified config files

These fsyncs were added for what turned out to be a fairly bogus
reason; I was hitting read errors from extlinux after upgrades and out
of conservatisim tried adding fsync calls, but the *actual* problem
was that extlinux didn't support 64 bit ext4.  Now that at least for
Project Atomic hosts we're just targeting grub2, we can drop these
fsync calls and rely on `syncfs()` being both faster and catching any
errors.
This commit is contained in:
Colin Walters 2015-04-19 12:34:01 -04:00
parent c58a5c0cb3
commit 45406bf815
2 changed files with 12 additions and 25 deletions

@ -1 +1 @@
Subproject commit 381ca54ee3a47de291d26a5db8772732fb4a9d59
Subproject commit 371172bcfd869867cf1c2847fcbbb3aa22adddb6

View File

@ -79,11 +79,11 @@ dirfd_copy_attributes_and_xattrs (int src_parent_dfd,
}
static gboolean
copy_dir_recurse_fsync (int src_parent_dfd,
int dest_parent_dfd,
const char *name,
GCancellable *cancellable,
GError **error)
copy_dir_recurse (int src_parent_dfd,
int dest_parent_dfd,
const char *name,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
int src_dfd = -1;
@ -133,26 +133,19 @@ copy_dir_recurse_fsync (int src_parent_dfd,
if (S_ISDIR (child_stbuf.st_mode))
{
if (!copy_dir_recurse_fsync (src_dfd, dest_dfd, name,
cancellable, error))
if (!copy_dir_recurse (src_dfd, dest_dfd, name,
cancellable, error))
goto out;
}
else
{
if (!glnx_file_copy_at (src_dfd, name, &child_stbuf, dest_dfd, name,
GLNX_FILE_COPY_OVERWRITE | GLNX_FILE_COPY_DATASYNC,
GLNX_FILE_COPY_OVERWRITE,
cancellable, error))
goto out;
}
}
/* And finally, fsync the fd */
if (fsync (dest_dfd) != 0)
{
gs_set_error_from_errno (error, errno);
goto out;
}
ret = TRUE;
out:
if (srcd)
@ -330,15 +323,15 @@ copy_modified_config_file (int orig_etc_fd,
if (S_ISDIR (modified_stbuf.st_mode))
{
if (!copy_dir_recurse_fsync (modified_etc_fd, new_etc_fd, path,
cancellable, error))
if (!copy_dir_recurse (modified_etc_fd, new_etc_fd, path,
cancellable, error))
goto out;
}
else if (S_ISLNK (modified_stbuf.st_mode) || S_ISREG (modified_stbuf.st_mode))
{
if (!glnx_file_copy_at (modified_etc_fd, path, &modified_stbuf,
new_etc_fd, path,
GLNX_FILE_COPY_OVERWRITE | GLNX_FILE_COPY_DATASYNC,
GLNX_FILE_COPY_OVERWRITE,
cancellable, error))
goto out;
}
@ -350,12 +343,6 @@ copy_modified_config_file (int orig_etc_fd,
goto out;
}
if (fsync (dest_parent_dfd) != 0)
{
gs_set_error_from_errno (error, errno);
goto out;
}
ret = TRUE;
out:
if (dest_parent_dfd != -1)