Commit Graph

60 Commits

Author SHA1 Message Date
Simon McVittie 592e798794 New upstream version 2017.10 2017-08-29 15:42:08 +01:00
Colin Walters 6063bdb013 Update libglnx
This is mostly the `copy_file_range` changes plus the Coverity files.

```
Colin Walters (4):
      localalloc: Abort on EBADF from close() by default
      local-alloc: Remove almost all macros like glnx_free, glnx_unref_variant
      console: Fix Coverity NULL deref warning
      fdio: Merge systemd code to use copy_file_range(), use FICLONE

Jonathan Lebon (1):
      console: trim useless check

Matthew Leeds (1):
      dirfd: Fix typo in comment

Philip Withnall (1):
      glnx-console: Add missing NULL check before writing out text
```

Update submodule: libglnx

Closes: #1081
Approved by: jlebon
2017-08-16 12:56:48 +00:00
Simon McVittie e5ac0cef85 New upstream version 2017.9 2017-07-28 08:57:43 +01:00
Colin Walters 0985158be7 Update libglnx, port some uses to newer APIs
Mostly for the latest `-Wmaybe-uninitialized` fix, but while here also port some
places to newer APIs.

Update submodule: libglnx

Closes: #1027
Approved by: jlebon
2017-07-24 18:43:57 +00:00
Simon McVittie b6c0af922c New upstream version 2017.8 2017-07-18 22:18:02 +01:00
Colin Walters 2a9689b76a Update libglnx, port various bits to new API
Using the error prefixing in the delta processing allows us to
do new code style.  Also strip trailing whitespace.

Use error prefixing in a few other random places.  I didn't
hunt for all of them, just testing out the new API.

Use `glnx_fchmod()`.  Also note I dropped one `fchmod (tmpf, 0600)`
which is no longer necessary.

Update submodule: libglnx

Closes: #1011
Approved by: jlebon
2017-07-18 19:18:38 +00:00
Jonathan Lebon d5dd576d20 pull: fix GLNX_HASH_TABLE_FOREACH_KV regressions
These are regression from #971. We were stuffing a pointer size inside a
variable of integer size. So the assignment was spilling over into other
variables' storage space. Actually use a gpointer and GPOINTER_TO_[U]INT
as was done originally.

Also bump libglnx which has static checks for this error in the future.

Update submodule: libglnx

Closes: #990
Approved by: cgwalters
2017-06-30 16:26:53 +00:00
Colin Walters ba918e49c5 tree-wide: Misc porting to newer libglnx APIs
- Use the new tmpfile bits
 - `glnx_try_fallocate`
 - `glnx_renameat()`

Depends: https://github.com/GNOME/libglnx/pull/57

Update submodule: libglnx

Closes: #970
Approved by: jlebon
2017-06-28 15:27:56 +00:00
Colin Walters 5776d5dcc0 Port to GLnxTmpfile
There's lots of mechanically replacing `OtTmpFile` with `GLnxTmpfile`;
the biggest changes are in the commit path.  Symlink commits are now
very clearly separated from regular files.  Symlinks are `OtCleanupUnlinkat`,
and regular files are `GLnxTmpfile`.

The commit codepath separates those as `_ostree_repo_commit_path_final()` and
`_ostree_repo_commit_tmpf_final()`. A nice aspect of all of this is that they
both *consume* the temporary on success. This avoids an extra spurious
`unlink()` call.

One of the biggest bits of code motion is in `commit_loose_regfile_object()`,
which no longer needs to care about symlinks. For the most parth though it's
just removing conditionals.

Update submodule: libglnx

Closes: #958
Approved by: jlebon
2017-06-27 22:02:14 +00:00
Simon McVittie e3060b1b87 New upstream version 2017.6 2017-05-24 19:00:16 +01:00
Jonathan Lebon 23c60cda22 libglnx: bump and use new helper methods
Update submodule: libglnx

Closes: #857
Approved by: cgwalters
2017-05-12 21:02:16 +00:00
Colin Walters 63497c65f3 checkout/commit: Use glnx_regfile_copy_bytes() if possible
Rather than `g_output_stream_splice()`, where the input is a regular
file.

See https://github.com/GNOME/libglnx/pull/44 for some more information.

I didn't try to measure the performance difference, but seeing the
read()/write() to/from userspace mixed in with the pointless `poll()` annoyed me
when reading strace.

As a bonus, we will again start using reflinks (if available) for `/etc`,
which is a regression from the https://github.com/ostreedev/ostree/pull/797
changes (which before used `glnx_file_copy_at()`).

Also, for the first time we'll use reflinks when doing commits from file-backed
content. This happens in `rpm-ostree compose tree` today for example.

Update submodule: libglnx

Closes: #817
Approved by: jlebon
2017-05-10 15:10:30 +00:00
Simon McVittie 0b7290b235 New upstream version 2017.4 2017-04-17 15:25:30 +01:00
Colin Walters 4cf210b128 Bump libglnx, port a few callers to new error API
Testing out the waters here. I think we should roll this into any future code
cleanup reworking we do.

Closes: #747
Approved by: jlebon
2017-03-22 16:04:58 +00:00
Simon McVittie 057de00126 New upstream version 2017.3 2017-03-10 23:16:34 +00:00
Jonathan Lebon c4f6522829 libglnx: bump for -Wmaybe-uninitialized fix
https://github.com/GNOME/libglnx/pull/37

Closes: #715
Approved by: cgwalters
2017-03-02 20:35:24 +00:00
Colin Walters 6d7e85bb38 libglnx: Re-bump to master due to accidental reversion
Commit a1805d6101 reverted
this unintentionally.

We should have some CI check that requires a commit message has
something like "libglnx bump" or something?

Closes: #693
Approved by: jlebon
2017-02-21 16:59:19 +00:00
Giuseppe Scrivano a1805d6101 contrib/golang: rm directory
rm -r the directory since we are keeping the Go bindings separately
under https://github.com/ostreedev/ostree-go

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #690
Approved by: cgwalters
2017-02-16 20:00:44 +00:00
Colin Walters 5a73a366b9 libglnx: Bump
Pulls in the xattr fixes and the tempname perf improvement.

Closes: #680
Approved by: jlebon
2017-02-14 14:02:59 +00:00
Simon McVittie d02ef65cdc New upstream version 2016.13 2016-11-20 15:41:33 +00:00
Colin Walters 396563e7e9 libglnx: Bump to master (for -fsanitize fixes)
Closes: #552
Approved by: jlebon
2016-10-28 17:47:50 +00:00
Simon McVittie f04805f646 New upstream version 2016.11 2016-10-07 21:52:21 +01:00
Colin Walters 54621d9e53 libglnx: Update to latest
This pulls in a new compilation flag for wrpseudo compatibility.  Also
note we need to add some includes since glnx-libcontainer went away,
and with it some includes for `sys/mount.h` etc.

Closes: #522
Approved by: cgwalters
2016-10-06 11:54:39 +00:00
Simon McVittie 9caebfc847 New upstream version 2016.9 2016-09-06 09:14:29 +01:00
Simon McVittie ba02f3eb2f New upstream version 2016.8 2016-09-06 09:01:54 +01:00
Colin Walters a29bb0ab6b Final excision of libgsystem dependency
Lots and lots of preparation led to this moment - when nothing
apparent changes for users!  Woo!

But seriously, having the extra dependency is a minor annoyance, and
in the big picture I think the libgsystem idea was wrong - we need to
land things in GLib, and use git submodules for API-unstable or
Linux-specific sharing.  For a lot of OSTree, the libgsystem `GFile*`
orientation was also wrong, we really want fd-relative.

Closes: #444
Approved by: jlebon
2016-08-09 15:36:09 +00:00
Simon McVittie 64e4525793 Update libglnx: Add missing files to libglnx distribution
This fixes distcheck.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #436
Approved by: cgwalters
2016-08-05 19:41:09 +00:00
Colin Walters 30aa1ec668 lib: Use libglnx file replace API more consistently
We have a better API now, drop use of the internal helper, which also
depended on libgsystem.

This required bumping libglnx to pull in a fix.

Closes: #429
Approved by: giuseppe
2016-08-04 21:27:32 +00:00
Colin Walters 1ce633f158 Update libglnx for O_TMPFILE build time option
See: https://github.com/ostreedev/ostree/issues/421

Closes: #426
Approved by: gatispaeglis
2016-08-04 13:30:55 +00:00
Jonathan Lebon f3cbe86117 libglnx: bump to latest
OSTree can sometimes print very long lines which lead to many empty
spaces getting printed if the output overflowed the line due to a bug in
libglnx.

Reported-by: Gatis Paeglis <gatis.paeglis@qt.io>

Closes: #406
Approved by: cgwalters
2016-07-22 13:44:19 +00:00
Simon McVittie 24762929e2 Imported Upstream version 2016.6 2016-06-26 12:12:26 +01:00
Yu Qi Zhang 30c34b2f55 libglnx porting: delete temp files on failure of file creation
We noticed the temp files being left over in ostree when (mistakenly)
trying to create refs with names in use by folders. This fix removes
temp files created by glnx_file_replace_contents_at on failure.

Closes: #348
Approved by: cgwalters
2016-06-16 19:18:47 +00:00
Colin Walters 24cb0ffc6a core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too.

Closes: #311
Approved by: jlebon
2016-05-31 18:08:46 +00:00
Colin Walters 6724519080 libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.

Closes: #282
Approved by: jlebon
2016-05-06 14:29:59 +00:00
Colin Walters a6c731f6e7 libglnx porting: Migrate from GSConsole
To GLnxConsoleRef.  There were some subtleties here, for example we
used to reference `GSConsole` inside the progress changed function,
which at first seems like an ABI hazard, because e.g. rpm-ostree or
xdg-app could still be passing a `GSConsole` instance there.  Luckily,
it turns out to be compatible to just start calling libglnx here.

Another issue was that due to libglnx's use of the cleanup function,
we needed to ensure we always called `ostree_async_progress_finish()`
*before* the cleanup function was invoked.

Closes: #280
Approved by: giuseppe
2016-05-02 11:41:00 +00:00
Simon McVittie 67e83bd769 Imported Upstream version 2016.3 2016-03-11 08:08:04 +00:00
Colin Walters ca57ec4aa5 repo: Port -refs.c to openat()
I'd like to incrementally convert all of `ostree-repo*.c` to
fd-relative usage, so that we can sanely introduce
`ostree_repo_new_at()` which doesn't involve GFile.

This one is medium risk, but passes the test suite.
2016-01-28 14:57:13 -05:00
Simon McVittie 62a4fef292 Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
Alexander Larsson 211ca6795c Update to latest libglnx 2015-12-14 08:37:17 +01:00
Matthew Barnes 70e121c159 glnx: Update from master
More autocleanup backports, this time GFileOutputStream.
2015-11-23 14:49:06 -05:00
Matthew Barnes 3267267115 libglnx: Update from master
Pick up PATH change for glnx_libcontainer_run_chroot_private().
2015-09-16 14:19:05 -04:00
Colin Walters 2dfe24632a sysroot: Add a try_lock() API
The blocking locking API wasn't sufficient for use in the rpm-ostree
daemon; it really wants to know if the lock is held, then continue to
do other things (like service DBus requests), and get notification
when the lock is available.

We also add an async variant that can be called if the lock is not
available.

Implement a higher level "loop until lock is available" method in the
`ostree admin` commandline.
2015-05-10 16:20:53 -04:00
Matthew Barnes e0f066e9c2 libglnx: Pick up bugfix and backports
Need more autocleanup backports for GIO types.
2015-05-06 10:28:31 -04:00
Giuseppe Scrivano 9fa10e69f9 libglnx: fix reference to commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-05 16:23:51 +02:00
Colin Walters 9ef98fd05a sysroot: Add an API to lock
If a system administrator happens to type `ostree admin upgrade`
multiple times, currently that will lead to a potentially corrupted
system.

I originally attempted to do locking *internally* in `libostree`, but
that didn't work out because currently a number of the commands
perform multi-step operations that all need to be serialized.  All of
the current code in `ostree admin deploy` is an example.

Therefore, allow callers to perform locking, as most of the higher
level logic is presently implemented there.

At some point, we can revisit having internal locking, but it will be
difficult.  A more likely approach would be similar to Java's approach
with concurrency on iterators - a "fail fast" method.
2015-05-05 08:52:44 -04:00
Matthew Barnes 33b0667597 Fix build when using GLib < 2.44 2015-05-04 12:02:02 -04:00
Colin Walters e0b73d0742 deploy: Drop a fsync, use fd-relative APIs
Now that we can rely on `syncfs()`, drop another fsync in the deploy
path.  While we're here, convert it to fd-relative.
2015-04-20 21:03:23 -04:00
Colin Walters 45406bf815 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.
2015-04-20 21:03:23 -04:00
Colin Walters 02b3a81d11 libglnx: Update from master
No real changes, but I'd like to use some of the new APIs later.
2015-04-17 16:15:55 -04:00
Colin Walters e5e0b95e27 libglnx: Update to latest
This pulls in more fixes for writes.
2015-04-14 15:53:51 -04:00