moby/daemon/containerd
Djordje Lukic aec7a80c6f
c8d: Use reference counting while mounting a snapshot
Some snapshotters (like overlayfs or zfs) can't mount the same
directories twice. For example if the same directroy is used as an upper
directory in two mounts the kernel will output this warning:

    overlayfs: upperdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.

And indeed accessing the files from both mounts will result in an "No
such file or directory" error.

This change introduces reference counts for the mounts, if a directory
is already mounted the mount interface will only increment the mount
counter and return the mount target effectively making sure that the
filesystem doesn't end up in an undefined behavior.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
(cherry picked from commit 32d58144fd)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-06-20 12:54:03 -06:00
..
cache.go c8d/builder: implement cache 2023-05-11 19:13:51 +01:00
handlers.go c8d/handlers: Handle error in walkPresentChildren 2023-06-02 15:09:28 +02:00
image.go c8d/inspect: Fill Created time if available 2023-05-25 21:28:22 +02:00
image_builder.go c8d/builder: implement cache 2023-05-11 19:13:51 +01:00
image_changes.go c8d: Handle nil container.ImageManifest 2023-04-26 14:54:01 +02:00
image_children.go c8d: implement missing image delete logic 2023-05-10 17:52:42 +01:00
image_children_test.go c8d: Implement Children by comparing diff ids 2023-04-06 14:27:37 +02:00
image_commit.go c8d/builder: implement cache 2023-05-11 19:13:51 +01:00
image_delete.go c8d/handlers: Handle error in walkPresentChildren 2023-06-02 15:09:28 +02:00
image_events.go Add the events services to the containerd image service 2023-03-30 17:48:51 +02:00
image_exporter.go c8d/load: Don't unpack pseudo images 2023-06-02 15:09:25 +02:00
image_history.go c8d: fix image history for dangling images 2023-05-10 15:03:26 +01:00
image_import.go daemon/containerd: containerConfigToOciImageConfig: add ArgsEscaped 2023-04-29 00:20:07 +02:00
image_list.go c8d/list: Use walkImageManifests 2023-06-02 15:09:22 +02:00
image_manifest.go c8d/handlers: Handle error in walkPresentChildren 2023-06-02 15:09:28 +02:00
image_prune.go c8d/handlers: Handle error in walkPresentChildren 2023-06-02 15:09:28 +02:00
image_pull.go Merge pull request #45673 from thaJeztah/24.0_backport_consistent_alias 2023-06-01 12:34:00 -07:00
image_push.go containerd: set user-agent when pushing/pulling images 2023-06-01 17:10:08 +02:00
image_snapshot.go Make sure the image is unpacked for the current snapshotter 2023-06-01 22:50:53 +02:00
image_squash.go containerd-integration: prefer error over panic where possible 2022-09-07 22:01:49 +02:00
image_tag.go Send an event when an image is tagged 2023-04-04 11:32:02 +02:00
mount.go c8d: Use reference counting while mounting a snapshot 2023-06-20 12:54:03 -06:00
progress.go c8d/pull: Use same progress action as distribution 2023-05-24 13:03:15 +02:00
resolver.go containerd: add c8d version and storage-driver to User-Agent 2023-06-02 11:41:10 +02:00
service.go c8d: Use reference counting while mounting a snapshot 2023-06-20 12:54:03 -06:00
soft_delete.go c8d/list: Fix Repo(Digests|Tags) for untagged images 2023-02-23 19:54:21 +01:00
store.go c8d: Implement push 2023-03-30 19:53:02 +02:00