Skip to content

erofs-differ: fix filesystem UUID for tar-converted layers#12046

Merged
AkihiroSuda merged 1 commit intocontainerd:mainfrom
erofs:erofs-snapshotter
Jul 2, 2025
Merged

erofs-differ: fix filesystem UUID for tar-converted layers#12046
AkihiroSuda merged 1 commit intocontainerd:mainfrom
erofs:erofs-snapshotter

Conversation

@hsiangkao
Copy link
Copy Markdown
Member

@hsiangkao hsiangkao commented Jul 1, 2025

Derive filesystem UUIDs (lsblk -o +UUID) from the OCI layer digests (although diffIDs are better in principle, but they're unavailable by differs in advance) rather than generating a random one.

This allows EROFS to uniquely identify each layer using the content-addressable filesystem UUID.

Note: currently uuid.NewSHA1(uuid.NameSpaceURL, []byte("erofs:blobs/"+desc.Digest)) is used to generate filesystem UUIDs.

Comment thread plugins/diff/erofs/differ_linux.go Outdated
Derive filesystem UUIDs (`lsblk -o +UUID`) from the OCI layer digests
(although diffIDs are better in principle, but they're unavailable by
differs in advance) rather than generating a random one.  This allows
EROFS to uniquely identify each layer using the content-addressable
filesystem UUID.

It can also be used for reproducible builds. To achieve this, configure
`mkfs_options` with `-T0 --mkfs-time` (However, `--mkfs-time` requires
erofs-utils 1.8+; Otherwise, all inode timestamps will be reset w/o it):

``` toml
  [plugins."io.containerd.differ.v1.erofs"]
    mkfs_options = ["-T0 --mkfs-time"]
```

Fixes: c73c8e5 ("Introduce EROFS differ")
Signed-off-by: Gao Xiang <[email protected]>
@hsiangkao
Copy link
Copy Markdown
Member Author

hsiangkao commented Jul 2, 2025

/cc @dmcgowan @fuweid @djdongjin @cpuguy83
(another small PR...)

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jul 2, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Jul 2, 2025
Merged via the queue into containerd:main with commit 6fa6aa9 Jul 2, 2025
88 of 90 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jul 2, 2025
@hsiangkao
Copy link
Copy Markdown
Member Author

/cherry-pick release/2.1

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@hsiangkao: new pull request created: #12058

Details

In response to this:

/cherry-pick release/2.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/2.1.x PR commits are cherry picked into the release/2.1 branch size/S

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants