Re: [PATCH v2 00/13] Overlayfs lazy lookup of lowerdata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Giuseppe,

On 2023/5/26 09:59, Giuseppe Scrivano wrote:
Hi Amir,

Amir Goldstein <amir73il@xxxxxxxxx> writes:

On Thu, May 25, 2023 at 6:21 PM Alexander Larsson <alexl@xxxxxxxxxx> wrote:

Something that came up about this in a discussion recently was
multi-layer composefs style images. For example, this may be a useful
approach for multi-layer container images.

In such a setup you would have one lowerdata layer, but two real
lowerdirs, like lowerdir=A:B::C. In this situation a file in B may
accidentally have the same name as a file on C, causing a redirect
from A to end up in B instead of C.


I was under the impression that the names of the data blobs in C
are supposed to be content derived names (hash).
Is this not the case or is the concern about hash conflicts?

Would it be possible to have a syntax for redirects that mean "only
lookup in lowerdata layers. For example a double-slash path
//some/file.


Anything is possible if we can define the problem that needs to be solved.
In this case, I did not understand why the problem is limited to finding a file
by mistake in layer B.

If there are several data layers A:B::C:D why wouldn't we have the same
problem with a file name collision between C and D?

the data layer is constructed in a way that files are stored by their
hash and there is control from the container runtime on how this is
built and maintained.  So a file name collision would happen only when
on a hash collision.

Differently for the other layers we've no control on what files are in
the image, unless we limit to mount only one EROFS as the first lower
layer and then all the other lower layers are data layers.

Given your example above A:B::C:D, if both A and B are EROFS we are
limited in the files/directories that can be in B.

If my understanding is correct (hopefully), I might ask if it's the
proposal to pass in multiple composefs manifests (rather than one)
all together to overlayfs in one shot?


e.g. we have A/foo with the following xattrs:

trusted.overlay.metacopy=""
trusted.overlay.redirect="/1e/de1743e73b904f16924c04fbd0b7fbfb7e45b8640241e7a08779e8f38fc20d"

Now what would happen if /1e is present as a file in layer B?  It will
just cause the lookup for `foo` to fail with EIO since the redirect
didn't find any file in the layers below.

If my understanding is correct, alternative one way might one do
a merged manifest before mounting? (of course a new manifest is
generated, but I think if it could be acceptable since the whole
merging process is under control?)

My overall thought is that it seems another seperate new
enhancement (if it needs more discussion) and have we might need
to land this lazy lookup first upstream as the first step?
(since our internal overlayfs users benefit this optimization
 as well... I'd like to see it upstream)

If it's a pure use case discussion, ignore me. ;)

Many thanks,
Gao Xiang






[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux