lib/commit: Reuse txn dir for tmpfiles
authorColin Walters <walters@verbum.org>
Tue, 28 Nov 2017 11:14:29 +0000 (06:14 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 1 Dec 2017 19:00:18 +0000 (19:00 +0000)
commit72304a272c7df7870ce1cafb5e97b611fa2114a7
tree5cccf4b7885dbfed6b4dd9e2ee727ea4c5a8193d
parent277ce6b36dc05dbdfa3a01fccdcc3f7493d70e78
lib/commit: Reuse txn dir for tmpfiles

This closes a race condition I was seeing with `test-concurrency.py`. If we
don't have `O_TMPFILE` (or for symlinks) we'll create temporary files;
previously these would be subject to the date-based pruning because we set the
timestamp to 0 for objects.

Having our temporary files also in the txn staging dir ensures that they're
covered by the locking we do for that directory, and it's also generally cleaner
since the lifecycle of all the temporary data for a txn is in one place.

Closes: #1352
Approved by: dbnicholson
src/libostree/ostree-repo-commit.c