moby/daemon/graphdriver
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
..
aufs refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
btrfs refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
copy d/graphdriver/copy: support src fs w/o xattr support 2023-05-04 15:28:49 -04:00
devmapper refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
fuse-overlayfs refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
graphtest refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
lcow gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
overlay refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
overlay2 daemon: overlay2: Write layer metadata atomically 2023-10-23 20:21:51 +02:00
overlayutils refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
register Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
vfs golangci-lint: update to v1.49.0 2023-02-24 17:05:42 -05:00
windows refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
zfs Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
counter.go graphdriver: Fix RefCounter memory leak 2018-02-09 10:26:06 +08:00
driver.go daemon/graphdriver: normalize comment formatting 2019-11-27 15:43:23 +01:00
driver_freebsd.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_linux.go Really switch to moby/sys/mount* 2020-03-20 09:46:25 -07:00
driver_test.go refactor: move from io/ioutil to io and os package 2023-02-24 16:11:55 -05:00
driver_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2022-04-07 23:27:50 +02:00
driver_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
fsdiff.go gofmt GoDoc comments with go1.19 2023-02-24 17:05:41 -05:00
plugin.go goimports: fix imports 2019-09-18 12:56:54 +02:00
proxy.go Move plugin client creation to the extension point 2018-05-25 15:18:53 -04:00