moby/daemon/graphdriver/overlay2
Mike Sul 2f98ada8b4
daemon: overlay2: Write layer metadata atomically
When the daemon process or the host running it is abruptly terminated,
the layer metadata file can become inconsistent on the file system.
Specifically, `link` and `lower` files may exist but be empty, leading
to overlay mounting errors during layer extraction, such as:
"failed to register layer: error creating overlay mount to <path>:
too many levels of symbolic links."

This commit introduces the use of `AtomicWriteFile` to ensure that the
layer metadata files contain correct data when they exist on the file system.

Signed-off-by: Mike <mike.sul@foundries.io>
(cherry picked from commit de2447c2ab)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-23 20:21:51 +02:00
..
check.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
mount.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
overlay.go daemon: overlay2: Write layer metadata atomically 2023-10-23 20:21:51 +02:00
overlay_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
overlay_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00