You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
apt-get update failed on overlay storage driver #74
So this is a classic unlink-after-open use case. Applications use this pattern to create an anonymous file. 9p has special handling for write-after-open-unlink case but it seems it does not handle fstat-after-open-unlink.
It is a different issue than https://bugzilla.redhat.com/show_bug.cgi?id=1213602, which is caused by overlayfs when a file lives in the down layer, opening it RO and RW can result in data inconsistency. And its workaround is to do touch /var/lib/rpm/* that copies everything up to the upper layer. Yum added a a plugin to do it.
However, in our case, the operation pattern is:
create a new file
unlink it
write to it several times
fstat
So the file is in the upper layer in the first place. And above test program (and apt-get update) passes in a docker container backed by overlay.
Did you see it from apt-get update or did you write a program to do the same as https://bugzilla.redhat.com/show_bug.cgi?id=1213602 ? The same error exists if you use overlay. But it is different than as shown in strace apt-get update AFAICT.
The open() EACCESS failure boils down to qemu failing to create new files under a directory that it does not have write access to. However, since qemu is running as root, it is supposed to be able to create new files there.
Activity
bergwolf commentedon Apr 25, 2016
Looks like a limitation due to 9p?
On a running container:
bergwolf commentedon Apr 25, 2016
Above was distracted by
strace apt-get updatebergwolf commentedon Apr 25, 2016
I confirm that it fixes the problem by adding back 9p "cache=loose" mount option.
bergwolf commentedon Apr 25, 2016
So this is a classic unlink-after-open use case. Applications use this pattern to create an anonymous file. 9p has special handling for write-after-open-unlink case but it seems it does not handle fstat-after-open-unlink.
gnawux commentedon Apr 25, 2016
some related info
problem of overlay?
bergwolf commentedon Apr 26, 2016
It is a different issue than https://bugzilla.redhat.com/show_bug.cgi?id=1213602, which is caused by overlayfs when a file lives in the down layer, opening it RO and RW can result in data inconsistency. And its workaround is to do
touch /var/lib/rpm/*that copies everything up to the upper layer. Yum added a a plugin to do it.However, in our case, the operation pattern is:
So the file is in the upper layer in the first place. And above test program (and apt-get update) passes in a docker container backed by overlay.
gnawux commentedon Apr 28, 2016
I observed the same error with https://bugzilla.redhat.com/show_bug.cgi?id=1213602
bergwolf commentedon Apr 28, 2016
Did you see it from
apt-get updateor did you write a program to do the same as https://bugzilla.redhat.com/show_bug.cgi?id=1213602 ? The same error exists if you use overlay. But it is different than as shown instrace apt-get updateAFAICT.gnawux commentedon Apr 28, 2016
I saw it from
yum install, just the same output like the bugzilla.bergwolf commentedon Apr 28, 2016
That should be fixed by newer yum plugin, namingly
yum-plugin-ovlaccording to moby/moby#10180 (comment)gnawux commentedon Apr 28, 2016
no, the ovl plugin is present
bergwolf commentedon May 4, 2016
With the hack patch on 9p client (bergwolf/linux@084b4a5), I no longer see errors in both multiline cat and
apt-get update:bergwolf commentedon May 4, 2016
Well, spoke too soon... Another run gave me a different error:
Although multiline cat still works:
bergwolf commentedon May 4, 2016
The warning occurs because currently chown would fail in hyper container:
bergwolf commentedon May 4, 2016
yum install still fails with:
And that's because
And it seems that 9p's permission check does not allow root to bypass it. May be related to qemu squashing user mapping?
bergwolf commentedon May 5, 2016
The open() EACCESS failure boils down to qemu failing to create new files under a directory that it does not have write access to. However, since qemu is running as root, it is supposed to be able to create new files there.
The directory does not allow to be written by root.
Possibly the qemu process has lost CAP_DAC_OVERRIDE and CAP_CHOWN at some point.
bergwolf commentedon May 5, 2016
All qemu process capabilities are dropped by libvirt according to https://libvirt.org/drvqemu.html#securitycap
As a result:
And it cannot bypass 9p directory permission check due to missing CAP_DAC_OVERRIDE.
chown 9p files in a hyper container always fails as well due to QEMU process lacking CAP_CHOWN.
bergwolf commentedon May 5, 2016
The capabilities issue is solved by setting
clear_emulator_capabilities = 0in/etc/libvirt/qemu.conf, as stated in #77Then
yum install -y stracegoes through to the end till hitting #88bergwolf commentedon Dec 1, 2016
update:
The qemu 9p server does not support open()->unlink()->getattr() operation (fix available but not merged, http://patchwork.ozlabs.org/patch/626194/). kernel 9pfs client also needs fixing (patch available but not merged, https://github.com/ericvh/linux/commit/eaf70223eac094291169f5a6de580351890162a2).
So the hack (https://github.com/hyperhq/hyperstart/blob/master/build/kernel_patch/0001-HACK-9P-always-use-cached-inode-to-fill-in-v9fs_vfs_.patch) is necessary until both above fixes are merged, which seems unlikely in near future.
ref: https://bugs.launchpad.net/qemu/+bug/1336794