lib/repo: Don't syncfs or fsync() dirs if fsync opt is disabled
authorColin Walters <walters@verbum.org>
Mon, 18 Sep 2017 18:29:16 +0000 (14:29 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 21 Sep 2017 13:21:59 +0000 (13:21 +0000)
commit75150fe04a5dd830de87abfde99ce66ab9feb5a7
tree58f49b016ad179330409b4fdd16b1e11864a375d
parent7a8511e0ca9c4e2441077ad0f2872c35a199eebe
lib/repo: Don't syncfs or fsync() dirs if fsync opt is disabled

There are use cases for not syncing at all; think build cache repos, etc. Let's
be consistent here and make sure if fsync is disabled we do no sync at all.

I chose this opportunity to add tests using the shiny new strace fault
injection.  I can forsee using this for a lot more things, so I made
the support for detecting things generic.

Related: https://github.com/ostreedev/ostree/issues/1184

Closes: #1186
Approved by: jlebon
ci/build.sh
src/libostree/ostree-repo-commit.c
tests/basic-test.sh
tests/libtest.sh