After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757117 - disable fsync for checkout for deployments
disable fsync for checkout for deployments
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-10-26 01:42 UTC by Colin Walters
Modified: 2016-01-13 18:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Walters 2015-10-26 01:42:31 UTC
Now that we're using syncfs(), I don't see a reason to fsync() the directories anymore.
Comment 1 John Hiesey 2015-12-11 01:30:54 UTC
My first thought was that it would be safe to remove all of the blocks starting with `if (!self->disable_fsync)` in ostree-repo-checkout.c, but I now realize that this would change the behavior when ostree_repo_checkout_tree() or ostree_repo_checkout_tree_at() is used in a case other than creating a deployment, since there may not be any syncfs() calls afterward.

My second idea is to call ostree_repo_set_disable_fsync(repo, TRUE) in checkout_deployment_tree(), but doing this safely would also require storing the previous value of repo->disable_fsync so that it can be restored to its previous state before ostree_repo_set_disable_fsync() returns. This is certainly doable but is a bit messy.

Colin, do you have any thoughts on this? Am I at least right that this would do the right thing?
Comment 2 Colin Walters 2015-12-11 17:12:00 UTC
Broadly speaking I think we should encourage API users to ostree_repo_set_disable_fsync(repo, TRUE) and to synchronize externally if desired.

For the instance of OstreeRepo is owned by OstreeSysroot we could consider just unconditionally disabling fsync there.

The tricky part is that instance can and is exposed externally, so probably for backwards compat we'd need to perhaps create another instance when ostree_sysroot_get_repo() is invoked or so?

That said the second model (disable/enable) might just be simpler.
Comment 3 Colin Walters 2016-01-13 15:22:41 UTC
https://github.com/GNOME/ostree/pull/168