From: Vivek Goyal <vgoyal@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: "Ernst, Eric" <eric.ernst@intel.com>,
"mszeredi@redhat.com" <mszeredi@redhat.com>,
"kata-dev@lists.katacontainers.io"
<kata-dev@lists.katacontainers.io>,
Stefan Hajnoczi <stefanha@redhat.com>,
Amir Goldstein <amir73il@gmail.com>,
overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: Virtio-fs as upper layer for overlayfs
Date: Tue, 7 Jan 2020 08:37:58 -0500 [thread overview]
Message-ID: <20200107133758.GA15920@redhat.com> (raw)
In-Reply-To: <CAJfpegt0pB-jJUBEmewRgH6MMmj3__MNzZ9ScitgcEehr51awQ@mail.gmail.com>
On Tue, Jan 07, 2020 at 10:48:37AM +0100, Miklos Szeredi wrote:
> On Mon, Jan 6, 2020 at 11:18 PM <eric.ernst@intel.com> wrote:
>
> > Miklos, I'm still learning a bit more about fs implementations, so my
> > apologies if this should be obvious. For virtio-fs, one of the use cases
> > that is described is sharing memory between two guests (not necessarily
> > the Kata use case). I was guessing the dcache would be within the guest,
> > and that in at least the shared memory case, there's potential that a
> > revalidate may be neccesary, in case any changes are made by the second guest?
>
> Exactly.
>
> > (I could be mixing up the intended use for revalidate, though).
> >
> > Can you clarify that "not calling ->revalidate() should not be a
> > problem?"
>
> I was referring specifically to the overlayfs case. Overlayfs stacks
> on top of some other filesystems, i.e. when ->d_revalidate() is called
> on overlayfs it calls ->d_revalidate() on underlying fs. This only
> happens for the lower (read-only) layers, not the upper (read-write)
> layer. So if the underlying upper fs is modified from another guest,
> than that modification is not going to be reflected on the overlayfs.
> However, overlayfs documents any changes to underlying layers as
> resulting in undefined behavior. It would be strange if docker was
> relying on undefined behavior of overlayfs, so not doing the
> revalidation should not make a difference.
Hi Miklos,
Thanks for the explanation. I had the same question as Eric. So we will
basically rely on assumption that overlayfs upper (virtio-fs in this
case) is not shared and will not be modified underneath. Which probably
is true in this specific case. In fact I think even overlayfs lower will
not be modified as well because once docker prepares a rootfs for a
container, it is not shared by any other container. IOW, following
seems to be the setup.
xfs/ext4 --> overlayfs1 --> virtiofs --->overlayfs2
Docker on host will prepare container root overlayfs1 on host and export
that into container using virtiofs. IIUC, overlayfs1 mount point will
not be shared with any other container. Only overlayfs1/lower will be
shared with other overlayfs mount point to enable container image
sharing.
Given overlayfs1 will not be shared with other containers, that means
virtiofs is not changing outside this container. And docker will prepare
overlayfs2 inside contiainer for nested container. There also upper will
not be shared by other nested containers so even if we don't call
revalidate on upper, it should be fine for this configuration.
This is now all dependent on whether user has done the configuration right
and kernel can't enforce correct configuration.
Thanks
Vivek
next prev parent reply other threads:[~2020-01-07 13:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7904C889-F0AC-4473-8C02-887EF6593564@intel.com>
2020-01-06 18:35 ` Virtio-fs as upper layer for overlayfs Vivek Goyal
2020-01-06 19:58 ` Miklos Szeredi
2020-01-06 22:24 ` eric.ernst
2020-01-07 9:48 ` Miklos Szeredi
2020-01-07 13:37 ` Vivek Goyal [this message]
2020-01-07 16:09 ` Vivek Goyal
2020-01-13 19:56 ` Vivek Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200107133758.GA15920@redhat.com \
--to=vgoyal@redhat.com \
--cc=amir73il@gmail.com \
--cc=eric.ernst@intel.com \
--cc=kata-dev@lists.katacontainers.io \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@redhat.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.