[ostree] deploy: Drop fsync of modified config files
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] deploy: Drop fsync of modified config files
- Date: Tue, 21 Apr 2015 01:06:30 +0000 (UTC)
commit 45406bf8158bf76e242a8e521429dc67a482facf
Author: Colin Walters <walters verbum org>
Date: Sun Apr 19 12:34:01 2015 -0400
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.
libglnx | 2 +-
src/libostree/ostree-sysroot-deploy.c | 35 ++++++++++----------------------
2 files changed, 12 insertions(+), 25 deletions(-)
---
diff --git a/libglnx b/libglnx
index 381ca54..371172b 160000
--- a/libglnx
+++ b/libglnx
@@ -1 +1 @@
-Subproject commit 381ca54ee3a47de291d26a5db8772732fb4a9d59
+Subproject commit 371172bcfd869867cf1c2847fcbbb3aa22adddb6
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 5501fb5..62ea6fa 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]