[lxc-devel] [PATCH] lxc-destroy: actually work if underlying fs is overlayfs
Marko Ratkaj
marko.ratkaj at sartura.hr
Wed Mar 18 08:48:40 UTC 2015
Hi Serge,
On Mon, Mar 16, 2015 at 05:02:12PM +0000, Serge Hallyn wrote:
> One of the 'features' of overlayfs is that depending on whether a file
> is on the upper or lower dir you get back a different device from stat.
> That breaks our lxc_rmdir_onedev.
>
> So at lxc_rmdir_ondev check the device of the directory being deleted.
> If it is overlayfs, then skip the device check.
>
> Note this is unrelated to overlayfs snapshots - in those cases when you
> delete a container, /var/lib/lxc/$container/ does not actually have an
> overlayfs under it. Rather, to reproduce this you would
>
> sudo mkdir /opt/{lower,upper,workdir}
> sudo mount -t overlayfs -o lower=/opt/lower,upper=/opt/upper,workdir=/opt/workdir \
> lxc /var/lib/lxc
> sudo lxc-create -t download -n c1 -- -d ubuntu -r trusty -a amd64
> sudo lxc-destroy -n c1
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
This patch worked fine on ar71xx OpenWrt board with overlayfs.
Tested-by: Marko Ratkaj <marko.ratkaj at sartura.hr>
Marko
More information about the lxc-devel
mailing list