compose: Ensure we've cleaned up references to tmpfs workdir before umount
Otherwise the `umount()` will always fail. This hasn't been a problem so far while running in a external container (docker/systemd-nspawn), but is when running in `mock` because it doesn't set its namespace to be private. This should help Fedora's Bodhi, which uses rpm-ostree inside mock.
This commit is contained in:
parent
054ceebb76
commit
b7e8c7bdc5
@ -945,11 +945,19 @@ rpmostree_compose_builtin_tree (int argc,
|
||||
}
|
||||
|
||||
out:
|
||||
/* Move back out of the workding directory to ensure unmount works */
|
||||
(void )chdir ("/");
|
||||
|
||||
if (self->workdir_dfd != -1)
|
||||
(void) close (self->workdir_dfd);
|
||||
|
||||
if (workdir_is_tmp)
|
||||
{
|
||||
if (opt_workdir_tmpfs)
|
||||
(void) umount (gs_file_get_path_cached (self->workdir));
|
||||
if (umount (gs_file_get_path_cached (self->workdir)) != 0)
|
||||
{
|
||||
fprintf (stderr, "warning: umount failed: %m\n");
|
||||
}
|
||||
(void) gs_shutil_rm_rf (self->workdir, NULL, NULL);
|
||||
}
|
||||
if (self)
|
||||
|
Loading…
Reference in New Issue
Block a user