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:
parent
c58a5c0cb3
commit
45406bf815
2
libglnx
2
libglnx
|
|
@ -1 +1 @@
|
||||||
Subproject commit 381ca54ee3a47de291d26a5db8772732fb4a9d59
|
Subproject commit 371172bcfd869867cf1c2847fcbbb3aa22adddb6
|
||||||
|
|
@ -79,11 +79,11 @@ dirfd_copy_attributes_and_xattrs (int src_parent_dfd,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
copy_dir_recurse_fsync (int src_parent_dfd,
|
copy_dir_recurse (int src_parent_dfd,
|
||||||
int dest_parent_dfd,
|
int dest_parent_dfd,
|
||||||
const char *name,
|
const char *name,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
int src_dfd = -1;
|
int src_dfd = -1;
|
||||||
|
|
@ -133,26 +133,19 @@ copy_dir_recurse_fsync (int src_parent_dfd,
|
||||||
|
|
||||||
if (S_ISDIR (child_stbuf.st_mode))
|
if (S_ISDIR (child_stbuf.st_mode))
|
||||||
{
|
{
|
||||||
if (!copy_dir_recurse_fsync (src_dfd, dest_dfd, name,
|
if (!copy_dir_recurse (src_dfd, dest_dfd, name,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!glnx_file_copy_at (src_dfd, name, &child_stbuf, dest_dfd, name,
|
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))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And finally, fsync the fd */
|
|
||||||
if (fsync (dest_dfd) != 0)
|
|
||||||
{
|
|
||||||
gs_set_error_from_errno (error, errno);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
out:
|
out:
|
||||||
if (srcd)
|
if (srcd)
|
||||||
|
|
@ -330,15 +323,15 @@ copy_modified_config_file (int orig_etc_fd,
|
||||||
|
|
||||||
if (S_ISDIR (modified_stbuf.st_mode))
|
if (S_ISDIR (modified_stbuf.st_mode))
|
||||||
{
|
{
|
||||||
if (!copy_dir_recurse_fsync (modified_etc_fd, new_etc_fd, path,
|
if (!copy_dir_recurse (modified_etc_fd, new_etc_fd, path,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else if (S_ISLNK (modified_stbuf.st_mode) || S_ISREG (modified_stbuf.st_mode))
|
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,
|
if (!glnx_file_copy_at (modified_etc_fd, path, &modified_stbuf,
|
||||||
new_etc_fd, path,
|
new_etc_fd, path,
|
||||||
GLNX_FILE_COPY_OVERWRITE | GLNX_FILE_COPY_DATASYNC,
|
GLNX_FILE_COPY_OVERWRITE,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
@ -350,12 +343,6 @@ copy_modified_config_file (int orig_etc_fd,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fsync (dest_parent_dfd) != 0)
|
|
||||||
{
|
|
||||||
gs_set_error_from_errno (error, errno);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
out:
|
out:
|
||||||
if (dest_parent_dfd != -1)
|
if (dest_parent_dfd != -1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue